public void ThrowOverflowTest() { basic bstr = new basic() { one = 0xe }; ConnectionMock mock = new ConnectionMock(); mock.Write(sHGG.RawSerialize(bstr)); byte oneRe = mock.ReadByte(); Assert.AreEqual(oneRe, bstr.one); mock.ReadByte(); // throw }
void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Player")) { ba = other.GetComponent <basic> (); if (ba != null) { ba.extraJumpValue = wextraJumpsvalue; ba.jetpack = jetpackon; ba.topdown = topdownon; ba.boostmax = maxboost; } /*if (tp!=null){ * tp.limit = wlimit; * tp.clicks = 0; * }*/ } }
public bool inquire_inf(string User_ID, ref basic data) { MySqlConnection mysqlcon = this.GetMysqlConnection(); MySqlDataReader reader; mysqlcon.Open(); MySqlCommand mysqlcom = new MySqlCommand( "SELECT * FROM teacher_salary.基本信息 where 教师号 = '" + User_ID + "';", mysqlcon); reader = mysqlcom.ExecuteReader(CommandBehavior.SingleRow); if (reader.Read()) { data.name = reader["姓名"].ToString(); data.sex = reader["性别"].ToString(); data.organization = reader["单位名称"].ToString(); data.address_province = reader["省"].ToString(); data.address_city = reader["市"].ToString(); data.address_country = reader["县"].ToString(); data.address_detailed = reader["详细地址"].ToString(); data.telephone = reader["联系电话"].ToString(); mysqlcon.Close(); mysqlcon.Dispose(); reader.Close(); reader.Dispose(); return(true); } else { mysqlcon.Close(); mysqlcon.Dispose(); reader.Close(); reader.Dispose(); MessageBox.Show("没有查询到与" + User_ID + "的有关信息", "提示"); return(false); } }
// Method selection public void select(int num) { switch (num) { case 1: basic display = new basic(); display.one(); display.two(); display.three(); break; case 2: summation res = new summation(); res.four(); res.five(); res.six(); break; case 3: MultiplicationTable multiply = new MultiplicationTable(); multiply.seven(); break; case 4: PrimeNumbers printPrime = new PrimeNumbers(); printPrime.eight(); break; case 5: MaxNum maxi = new MaxNum(); maxi.nine(); break; case 6: ReverseList rev = new ReverseList(); rev.ten(); break; case 7: ContainsElement con = new ContainsElement(); con.eleven(); break; case 8: ReturnItemsOddPos oddPos = new ReturnItemsOddPos(); oddPos.twelve(); break; case 9: RunningTotal runTotal = new RunningTotal(); runTotal.thirteen(); break; case 10: Palindrome pali = new Palindrome(); pali.fourteen(); break; case 11: SumFunct sumF = new SumFunct(); sumF.fifteenA(); sumF.fifteenB(); sumF.fifteenC(); break; case 12: Concatenation conca = new Concatenation(); conca.display(); conca.seventeen(); conca.nineteen(); break; default: Console.WriteLine("Choose a valid option"); break; } }
private presence BuildFullPresence() { presence pres = this.PartialPublication ? new pidffull() : new presence(); pres.entity = this.FromUri; if (this.personId == null) { this.personId = String.Format("{0}{1:D7}", "p", ++MyPublicationSession.personIdCounter); } basic status = basic.closed; String note = "Offline"; BogheCore.Generated.rpid.ItemsChoiceType activity = BogheCore.Generated.rpid.ItemsChoiceType.unknown; switch (this.PresenceStatus) { case PresenceStatus.Busy: note = "Busy"; status = basic.open; activity = BogheCore.Generated.rpid.ItemsChoiceType.busy; break; case PresenceStatus.Away: note = "Away"; status = basic.open; activity = BogheCore.Generated.rpid.ItemsChoiceType.away; break; case PresenceStatus.Online: note = "Online"; status = basic.open; break; case PresenceStatus.HyperAvailable: note = "Hyper-Available"; status = basic.open; break; case PresenceStatus.BeRightBack: note = "Be Right Back"; status = basic.open; activity = BogheCore.Generated.rpid.ItemsChoiceType.vacation; break; case PresenceStatus.OnThePhone: note = "On The Phone"; status = basic.open; activity = BogheCore.Generated.rpid.ItemsChoiceType.onthephone; break; case PresenceStatus.OutToLunch: note = "Out To Lunch"; status = basic.open; activity = BogheCore.Generated.rpid.ItemsChoiceType.meal; break; } /*== Person ==*/ pres.Persons = new person[1] { new person() }; pres.Persons[0].id = this.personId; pres.Persons[0].timestamp = Rfc3339DateTime.ToString(DateTime.UtcNow); pres.Persons[0].overridingWillingness = new overridingwillingness(); pres.Persons[0].overridingWillingness.basicSpecified = true; pres.Persons[0].overridingWillingness.basic = (status == basic.closed) ? basicType.closed : basicType.open; if (this.PresenceStatus == PresenceStatus.HyperAvailable) { /* The RCS HyperAvailability information is carried by the OMA Overriding Willingness combined with an "until" value as specified in * [Presence2.0_DDS], with element basic->open. */ pres.Persons[0].overridingWillingness.Until = Rfc3339DateTime.ToString(DateTime.UtcNow.AddMinutes(this.HyperAvailabilityTimeout)); } pres.Persons[0].note = new BogheCore.Generated.data_model.Note_t[1] { new BogheCore.Generated.data_model.Note_t() }; pres.Persons[0].note[0].Value = String.IsNullOrEmpty(this.FreeText) ? note : this.FreeText; pres.Persons[0].activities = new activities(); pres.Persons[0].activities.ItemsElementName = new BogheCore.Generated.rpid.ItemsChoiceType[1]; pres.Persons[0].activities.ItemsElementName[0] = activity; pres.Persons[0].activities.Items = new BogheCore.Generated.rpid.empty[1]; pres.Persons[0].activities.Items[0] = new BogheCore.Generated.rpid.empty(); /*pres.Persons[0].mood = new mood(); * pres.Persons[0].mood.ItemsElementName = new ItemsChoiceType1[1]; * pres.Persons[0].mood.ItemsElementName[0] = this.Mood; * pres.Persons[0].mood.Items = new BogheCore.Generated.rpid.empty[1]; * pres.Persons[0].mood.Items[0] = new BogheCore.Generated.rpid.empty();*/ if (!String.IsNullOrEmpty(this.StatusIconUrl)) { pres.Persons[0].statusicon = new statusicon(); pres.Persons[0].statusicon.Value = this.StatusIconUrl; } if (!String.IsNullOrEmpty(this.HomePage)) { pres.Persons[0].homepage = this.HomePage; } /*== device ==*/ pres.Device = new device(); pres.Device.id = String.Format("{0}{1}", "d", "0001"); pres.Device.deviceID = RCSService.DEVICE_ID; pres.Device.Status = new status(); pres.Device.Status.basicSpecified = true; pres.Device.Status.basic = status; pres.Device.DeviceCapabilities = new BogheCore.Generated.pidf_caps.devcaps(); pres.Device.DeviceCapabilities.mobility = new BogheCore.Generated.pidf_caps.mobilitytype(); pres.Device.DeviceCapabilities.mobility.supported = new BogheCore.Generated.pidf_caps.mobilitytypes(); pres.Device.DeviceCapabilities.mobility.supported.@fixed = String.Empty; pres.Device.NetworkAvaibility = new networkavailability(); pres.Device.NetworkAvaibility.network = new networkavailabilityNetwork[1]; pres.Device.NetworkAvaibility.network[0] = new networkavailabilityNetwork(); pres.Device.NetworkAvaibility.network[0].id = "IMS"; pres.Device.NetworkAvaibility.network[0].active = new emptyType(); return(pres); }
public void Start() { playe = GameObject.FindGameObjectWithTag("Player").GetComponent <basic>(); }
// Use this for initialization void Start() { playersd = GameObject.FindGameObjectWithTag("Player").GetComponent <basic>(); sped = playersd.speed; }
void Awake() { player = GameObject.FindGameObjectWithTag("Player").transform; ba = player.GetComponent <basic> (); //tp = player.GetComponent<teleport> (); }
public Promo_items() { basic = new basic(); }
void Start() { robot = (basic)GameObject.FindGameObjectWithTag("robot").GetComponent <basic>(); }