using System;
using System.Net.Http;
using System.Windows.Forms;
using System.Text.Json;
using System.Threading.Tasks;
namespace WinFormsApp4
{
public partial class Form1 : Form
{
HttpResponseMessage response;
string Address = "https://kad.arbitr.ru/Kad/SearchInstances";
class Search {
public int Page { get; set; }
public int Count { get; set; }
public string[] Courts { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
public Sides[] Sides { get; set; }
public Judges[] Judges { get; set; }
public string[] CaseNumbers { get; set; }
public bool WithVKSInstances { get; set; }
}
class Sides
{
public string Name { get; set; }
public int Type { get; set; }
public bool ExactMatch { get; set; }
}
class Judges
{
public string JudgeId { get; set; }
public int Type { get; set; }
}
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Search search = new Search()
{
CaseNumbers = Array.Empty<string>(),
Page = 1,
Count = 25,
Courts = Array.Empty<string>(),
DateFrom = null,
DateTo = null,
Sides = Array.Empty<Sides>(),
Judges = Array.Empty<Judges>(),
WithVKSInstances = false
};
try
{
PostRequest(search);
label2.Text += response.Content.ToString();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private async void PostRequest(Search data)
{
Uri uri = new Uri(Address);
HttpContent content = new StringContent(JsonSerializer.Serialize(data));
HttpClient http = new HttpClient();
response = await http.PostAsync(uri, content);
}
}
}
using UnityEngine;
public class MotherBoardPlace : MonoBehaviour
{
Collision collision;
private void OnCollisionEnter(Collision collision)
{
this.collision = collision;
switch(collision.collider.tag)
{
case "Processor":
Place("ProcessorPlace", new Vector3(0, 0, 0));
break;
case "ram":
Place("RamPlace", new Vector3(-90, 0, 90));
break;
}
}
private void Place(string TagName, Vector3 Angle)
{
collision.rigidbody.isKinematic = true;
collision.rigidbody.detectCollisions = false;
collision.rigidbody.useGravity = false;
collision.transform.parent = transform;
collision.transform.eulerAngles = Angle;
collision.transform.localPosition = transform.Find(TagName).localPosition;
}
}