private void checkRayInput() { Ray screenCamRay = gameObject.camera.ScreenPointToRay(new Vector2(Screen.width * 0.3f, Screen.height * 0.5f)); RaycastHit hit; if (!isInText) { if (Physics.Raycast(screenCamRay, out hit)) { if (hit.collider.gameObject.tag == "Info") { GetInformation infoBox = hit.collider.gameObject.GetComponent <GetInformation>(); renderClass.updateInput(infoBox.getheadLine1(), "Auswählen", infoBox.getheadInfoText(), infoBox.getIcon()); if (Input.GetAxis("A_Button") > 0) { Debug.Log("A_Button!"); isInText = true; } } else { if (!isInText) { renderClass.stopDrawing(); } } } } }
//消费ID的信息查询 public Consumption GetConsumption(string p_ConsumptionId) { GetInformation.address = "consumptions/" + p_ConsumptionId;//桌子状态信息 GetInformation gi = new GetInformation(); string result = gi.GetHTTPInfo(); var jserConsumption = new JavaScriptSerializer(); Consumption personsConsumption = jserConsumption.Deserialize<Consumption>(result);//解析json数据 return personsConsumption; }
private ConsumptionObj GetConsumptionObj(string p_ConsumptionId) { GetInformation.address = "consumptions/" + p_ConsumptionId; GetInformation gc = new GetInformation(); string result = gc.GetHTTPInfo(); //接收JSON数据 var consumption = new JavaScriptSerializer(); var personsConsumption = consumption.Deserialize<Consumption>(result); //解析json数据 ConsumptionObj obj = new ConsumptionObj(); obj.Consumption = personsConsumption; return obj; }
//弹出提示框,给工作人员名单 public WordHelper SetReportBasicInfo(bool isManul) { Dictionary <string, string> dict = new Dictionary <string, string>(); helper.CreateNewDocument(this.模板路径); string 人员名字 = "我是谁"; if (isManul) { //窗口获取实验人员信息 GetInformation Inf = new GetInformation("请输入实验人员的姓名"); 人员名字 = Inf.ShowDialog() == DialogResult.OK && Inf.Value.Length > 0 ? Inf.Value : "XXXX"; } dict.Add("$人员$", 人员名字); dict.Add("$日期$", DateTime.Now.ToLongDateString()); dict.Add("$试验持续时间$", this.测试试验时间.ToString() + "s"); dict.Add("$试验最大压力$", this.试验最大压力.ToString() + "MPa"); helper.InserttextValue(dict); return(helper); }
private static void Menu() { while (true) { Console.Clear(); Console.Out.WriteLine("=================================================================="); Console.Out.WriteLine("1. Add Information "); Console.Out.WriteLine("2. Search "); Console.Out.WriteLine("3. Exit "); Console.Out.WriteLine("=================================================================="); int choise = 0; Console.Out.WriteLine("Select from menu : "); string input; while (!Regex.IsMatch(input = Console.ReadLine() ?? string.Empty, @"[1-3]")) { Console.Out.WriteLine("Enter Again id"); } ; choise = Convert.ToInt32(input); switch (choise) { case 1: // ModelPerson person = new ModelPerson(); model.AddInformation(GetInformation.GetInformationFromUser()); break; case 2: model.Search(GetInformation.GetQueryFromUser()); break; case 3: return; } } }
/// <summary> /// Handles all incoming packets into the server after fully recieving them /// </summary> /// <param name="packet">The packet that was recieved</param> /// <param name="clientSocket">The socket, used for sending back data to the client</param> public static void Handle(byte[] packet, Socket clientSocket) { // Get the packet length and type var packetLength = BitConverter.ToUInt32(packet, 0); var packetType = BitConverter.ToUInt16(packet, 4); Console.WriteLine("Recieved packet of length: {0} and Type: {1}", packetLength, packetType); // Packet types: // 2000 - Update the steam token // 2001 - Update the host id // 2002 - Request to Update all the things // 2003 - Request to Update the summary // 2004 // 3003 - Information to update the summary to the server switch (packetType) { case 2000: clientSocket.Send(new StdData(Program.SteamToken, 0, 2000).Data); break; case 2001: clientSocket.Send(new StdData("21", 0, 2001).Data); break; case 2002: clientSocket.Send(DataDealer.UpdateAll(new StdData(packet).MachineId)); break; case 2003: clientSocket.Send(DataDealer.UpdateSum(true, new StdData(packet).MachineId).Data); break; case 2004: clientSocket.Send(DataDealer.UpdateGames(true, new StdData(packet).MachineId).Data); break; case 2006: clientSocket.Send(DataDealer.UpdateFriends(true, new StdData(packet).MachineId).Data); break; case 2007: try { clientSocket.Send(new StdData("", 0, 1005).Data); clientSocket.Send(DataDealer.UpdateGameNames(new StdData(packet).MachineId).Data); } catch (Exception ex) { Console.WriteLine(ex.Message); } break; case 2050: clientSocket.Send( new StdData(GetInformation.ShowGenStats(new StdData(packet).MachineId), 0, 3050).Data); break; case 2051: try { clientSocket.Send(new StdData("", 0, 1005).Data); clientSocket.Send( new ListOfUsers(GetInformation.ShowPlayerStats(new StdData(packet)), 0, 3051).Data); } catch (Exception ex) { Console.WriteLine(ex.Message); } break; case 3003: var list = new ListOfUsers(packet); try { DataDealer.DealWithSum(list); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { clientSocket.Send(new StdData("", 0, 1000).Data); } break; case 3004: var gameUsers = new ListOfUsers(packet); try { DataDealer.DealWithGames(gameUsers); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { clientSocket.Send(new StdData("", 0, 1000).Data); } break; case 3006: var friends = new ListOfUsers(packet); try { clientSocket.Send(new StdData("", 0, 1005).Data); DataDealer.DealWithFriends(friends); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { clientSocket.Send(new StdData("", 0, 1000).Data); } break; case 3007: var games = new ListOfGames(packet); try { DataDealer.DealWithGameNames(games); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { clientSocket.Send(new StdData("", 0, 1000).Data); } break; } }
public KnowledgeRule(string ConnetionString) { //ConnStr = ConnetionString; db = new MDataBase(ConnetionString); GetInformation = new GetInformation(ConnetionString); }
//消费ID的信息查询 public void getconsumptionsid() { GetInformation.address = "consumptions/" + this.Txt_Master.Text;//桌子状态信息 if (this.Txt_Master.Text != "") { GetInformation gi = new GetInformation(); Str_consumptionsid = gi.GetHTTPInfo();//接收JSON数据 } else { Str_consumptionsid = ""; } }
//桌子传值 public void getstrTables() { GetInformation.address = "tables";//桌子 GetInformation gd = new GetInformation(); Str_Tables = gd.GetHTTPInfo();//接收JSON数据 }
//桌子状态信息查询 public void getstrstatus() { GetInformation.address = "statuses";//桌子状态信息 GetInformation gd = new GetInformation(); Str_Status = gd.GetHTTPInfo();//接收JSON数据 }