private void Mybutton2_Click(object sender, System.EventArgs e) { var Obj = new Data2(); Obj.Ora = Ora; Obj.Materie = Materie; var storage = SimpleStorage.EditGroup("DB"); var List = storage.Get(Zi); if (List != null && List != "") { var ObjectList = JsonConvert.DeserializeObject <List <Data2> >(List); ObjectList.Add(Obj); var SerieList = JsonConvert.SerializeObject(ObjectList); storage.Put(Zi, SerieList); } else { var ObjectList = new List <Data2>(); ObjectList.Add(Obj); var SerieList = JsonConvert.SerializeObject(ObjectList); storage.Put(Zi, SerieList); } }
public override int GetHashCode() { int hash = 1; if (Data1.Length != 0) { hash ^= Data1.GetHashCode(); } if (Data2.Length != 0) { hash ^= Data2.GetHashCode(); } if (Data3.Length != 0) { hash ^= Data3.GetHashCode(); } if (myOneOfCase_ == MyOneOfOneofCase.One) { hash ^= One.GetHashCode(); } if (myOneOfCase_ == MyOneOfOneofCase.Two) { hash ^= Two.GetHashCode(); } if (myOneOfCase_ == MyOneOfOneofCase.Three) { hash ^= Three.GetHashCode(); } hash ^= (int)myOneOfCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
/// <summary> /// Returns a hash-code based on the current value of this object. /// </summary> public override int GetHashCode() { return (Data1.GetHashCode() ^ Data2.GetHashCode() ^ Data3.GetHashCode()); }
public virtual void ReadChildData(BinaryReader reader) { int x = 0; for (x = 0; (x < _data.Count); x = (x + 1)) { Data.Add(new ByteBlockBlock()); Data[x].Read(reader); } for (x = 0; (x < _data.Count); x = (x + 1)) { Data[x].ReadChildData(reader); } for (x = 0; (x < _data2.Count); x = (x + 1)) { Data2.Add(new ByteBlockBlock()); Data2[x].Read(reader); } for (x = 0; (x < _data2.Count); x = (x + 1)) { Data2[x].ReadChildData(reader); } _effectName.ReadString(reader); for (x = 0; (x < _data3.Count); x = (x + 1)) { Data3.Add(new ByteBlockBlock()); Data3[x].Read(reader); } for (x = 0; (x < _data3.Count); x = (x + 1)) { Data3[x].ReadChildData(reader); } }
public void Create_instance_of_removed_event() { var data = new Data2(); var instance = _subject.FindRemovedEvent(data); ((Data2Removed)instance).Data.Should().BeSameAs(data); }
public void Should_not_create_instance_for_missing_data_type_for_updated() { var data = new Data2(); var result = _subject.FindUpdatedEvent(data); result.Should().BeNull(); }
public MainPage() { this.InitializeComponent(); Data MyData = new Data(); MyData.Data_in(); samsung.ItemsSource = MyData.myList; Data2 MyData2 = new Data2(); MyData2.Data_in(); htc.ItemsSource = MyData2.myList2; Data3 MyData3 = new Data3(); MyData3.Data_in(); nokia.ItemsSource = MyData3.myList3; Data4 MyData4 = new Data4(); MyData4.Data_in(); sony.ItemsSource = MyData4.myList4; }
public static void TestPropertyInitializer() { var d2 = new Data2(); Assert.AreEqual(0, d2.Value1); Assert.AreEqual(0, d2.Value2); var d3 = new Data3(); Assert.AreEqual(2, d3.Value1); Assert.AreEqual(1, d3.Value2); Assert.Null(d3.Value3); Assert.AreEqual(2, d3.Value4); Assert.AreEqual(1, d3.Value5); Assert.Null(d3.Value6); Assert.AreEqual(2, d3.Value7); Assert.AreEqual(1, d3.Value8); Assert.Null(d3.Value9); var d4 = new Data4(); Assert.AreEqual(2, d4.Value1); Assert.AreEqual(1, d4.Value2); Assert.AreEqual(0, d4.Value3); Assert.AreEqual(2, d4.Value4); Assert.AreEqual(1, d4.Value5); Assert.AreEqual(0, d4.Value6); Assert.AreEqual(2, d4.Value7); Assert.AreEqual(1, d4.Value8); Assert.AreEqual(0, d4.Value9); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { Named named = null; Data1 d1 = value as Data1; if (d1 != null) { named = d1.Xxx; } else { Data2 d2 = value as Data2; if (d2 != null) { named = d2.Yyy; } } if (named != null) { return(named); } return(DependencyProperty.UnsetValue); }
public void ToSubClassTest() { var d = new Data2 { Name = "huangxd" }; Console.WriteLine(d.To <Data1>().Name); }
public static void Main(string[] args) { IS2Container s2c = S2ContainerFactory.Create(PATH); Data2 data = s2c.GetComponent("data3") as Data2; Console.WriteLine("id : {0}", data.LinkData.Id); }
public static void InheritanceTest14() { Data2 data = new Data2(); GenericInheritanceTestCls <Data2> instance = new GenericInheritanceTestCls <Data2>(data); instance.TestVirtual(); }
public void SetTempData2([FromBody] Data2 tempDataValue) { // Set your TempData key to the value passed in var Fra = tempDataValue.Start.ToString("yyyy-MM-dd"); var To = tempDataValue.End.ToString("yyyy-MM-dd"); TempData["Fra"] = Fra; TempData["Til"] = To; }
private async void ContinousAdding() { for (int i = 0; i < 10; i++) { await Task.Delay(1000); Data2.Add(i); } }
/// <summary> /// Checks a search string to see if any of the data objects exclude it. /// </summary> public bool DataExcludes(string search) { if (Data1.Contains(search) || Data2.Contains(search) || Data3.Contains(search) || Data4.Contains(search) || Data5.Contains(search) || Data6.Contains(search) || Data7.Contains(search) || Data8.Contains(search) || Data9.Contains(search) || Data10.Contains(search)) { return(false); } return(true); }
public override object GetData() { return(new Collection( Data0.ToString(CultureInfo.InvariantCulture), new Collection(Data1.ToString(CultureInfo.InvariantCulture), Data2.ToString(CultureInfo.InvariantCulture), FileName), "\"" + Name + "\"", Synonym.GetData(), "\"" + Comment + "\"" )); }
// item 被 drop 到了 borderDelete private void borderDelete_Drop(object sender, DragEventArgs e) { // 从数据源中删除指定的 Employee 对象 Data1.Remove(_draggingEmployee); Data2.Remove(_draggingEmployee); _draggingEmployee = null; // 在 borderDelete 放下了拖动项 Debug.WriteLine("Drop"); }
public void updateUiElements(int i) { Data1.Update(chrom[i][0]); Data2.Update(chrom[i][1]); Data2.Update(chrom[i][2]); Data2.Update(chrom[i][3]); Data2.Update(chrom[i][4]); Data2.Update(chrom[i][5]); Data2.Update(chrom[i][6]); Data2.Update(chrom[i][7]); Data2.Update(chrom[i][8]); }
public override int GetHashCode() { unchecked { var hashCode = (int)Data1; hashCode = (hashCode * 397) ^ Data2.GetHashCode(); hashCode = (hashCode * 397) ^ Data3.GetHashCode(); hashCode = (hashCode * 397) ^ Data4.GetHashCode(); hashCode = (hashCode * 397) ^ Guid.GetHashCode(); return(hashCode); } }
/// <summary> /// Full deserialization of JSON object into an object /// </summary> /// <param name="json">JSON object</param> private void FullDeserialization(OnlineMapsJSONItem json) { // Full deserialization Data data = json.Deserialize <Data>(); Debug.Log(data.text); // Deserialization into object with alias Data2 data2 = json.Deserialize <Data2>(); Debug.Log(data2.lItems[0].name); }
public void EventInPathRaisesPropertyChangedLevel1() { Data2 newData = new Data2(); newData.Items = new Data3[] { new Data3{Value = 300}, new Data3{Value = 400}, new Data3{Value = 500} }; this.EventHelper(() => this.Data.Data = newData, 400); }
public override int GetHashCode() { var hashCode = 1603895772; hashCode = hashCode * -1521134295 + base.GetHashCode(); hashCode = hashCode * -1521134295 + Type.GetHashCode(); hashCode = hashCode * -1521134295 + Label.GetHashCode(); hashCode = hashCode * -1521134295 + Offset.GetHashCode(); hashCode = hashCode * -1521134295 + Data1.GetHashCode(); hashCode = hashCode * -1521134295 + Data2.GetHashCode(); return(hashCode); }
public override int GetHashCode() { int hash = 311; unchecked { hash = hash + 709 * Data0.GetHashCode(); hash = hash * 443 + Data1.GetHashCode(); hash = hash * 269 + Data2.GetHashCode(); hash = hash * 653 + Data3.GetHashCode(); } return(hash); }
public override int GetHashCode() { int hash = 19; unchecked { hash = hash * 31 + Data0.GetHashCode(); hash = hash * 31 + Data1.GetHashCode(); hash = hash * 31 + Data2.GetHashCode(); hash = hash * 31 + Data3.GetHashCode(); } return(hash); }
public override int GetHashCode() { int hash = 19; unchecked { hash = hash + 31 * Data0.GetHashCode(); hash = hash * 479 + Data1.GetHashCode(); hash = hash * 593 + Data2.GetHashCode(); hash = hash * 347 + Data3.GetHashCode(); } return(hash); }
public virtual void ReadChildData(BinaryReader reader) { int x = 0; for (x = 0; (x < _data.Count); x = (x + 1)) { Data.Add(new ByteBlockBlock()); Data[x].Read(reader); } for (x = 0; (x < _data.Count); x = (x + 1)) { Data[x].ReadChildData(reader); } for (x = 0; (x < _data2.Count); x = (x + 1)) { Data2.Add(new ByteBlockBlock()); Data2[x].Read(reader); } for (x = 0; (x < _data2.Count); x = (x + 1)) { Data2[x].ReadChildData(reader); } for (x = 0; (x < _data3.Count); x = (x + 1)) { Data3.Add(new ByteBlockBlock()); Data3[x].Read(reader); } for (x = 0; (x < _data3.Count); x = (x + 1)) { Data3[x].ReadChildData(reader); } for (x = 0; (x < _data4.Count); x = (x + 1)) { Data4.Add(new ByteBlockBlock()); Data4[x].Read(reader); } for (x = 0; (x < _data4.Count); x = (x + 1)) { Data4[x].ReadChildData(reader); } for (x = 0; (x < _data5.Count); x = (x + 1)) { Data5.Add(new ByteBlockBlock()); Data5[x].Read(reader); } for (x = 0; (x < _data5.Count); x = (x + 1)) { Data5[x].ReadChildData(reader); } }
public override string ToString() { string str = Data1.ToString("X8") + '-' + Data2.ToString("X4") + '-' + Data3.ToString("X4") + '-'; for (int i = 0; i < 2; i++) { str += Data4[i].ToString("X2"); } str += '-'; for (int i = 2; i < 8; i++) { str += Data4[i].ToString("X2"); } return(str); }
public override int GetHashCode() { // .NET Standard does not have this method #if DEBUG return(HashCode.Combine(Data1, Data2, Data3, Data4)); #else int hashCode = -0x8CAC62A; hashCode = hashCode * -0x5AAAAAD7 + Data1.GetHashCode(); hashCode = hashCode * -0x5AAAAAD7 + Data2.GetHashCode(); hashCode = hashCode * -0x5AAAAAD7 + Data3.GetHashCode(); hashCode = hashCode * -0x5AAAAAD7 + EqualityComparer <byte[]> .Default.GetHashCode(Data4); return(hashCode); #endif }
public SpeedItem() { bg = new SolidBrush(Color.White); bgf = new SolidBrush(Color.White); fo = new SolidBrush(Color.Blue); pfo = new Pen(Color.Blue); pfod = new Pen(Color.Blue); pfod.DashStyle = DashStyle.Dash; Height = 50; for (int i = 0; i < 60; i++) { Data2.Add(0); Data.Add(0); } }
///<summary>Builds an embed out of the changed stats, and sends it as a Discord message </summary> /// <param Name="RedditInformation">All fetched stats of the user </param> /// <param Name="changedStats">All changed stats of the user, together with a string presenting them </param> /// <param Name="mostPlayed">The most played Hero of the session, together with a string presenting them </param> private async static Task <Embed> createEmbed(Data2 redditPost) { EmbedBuilder e = new EmbedBuilder(); e.Color = new Color(255, 49, 0); e.Title = redditPost.title.Length > 256 ? redditPost.title.Substring(0, 251) + "[...]" : redditPost.title; e.Url = "https://www.reddit.com" + redditPost.permalink; e.Description = redditPost.selftext.Length > 2048 ? redditPost.selftext.Substring(0, 2043) + "[...]" : redditPost.selftext; EmbedAuthorBuilder author = new EmbedAuthorBuilder(); author.Name = redditPost.author; author.Url = $"https://www.reddit.com/user/{redditPost.author}"; e.Author = author; EmbedFooterBuilder footer = new EmbedFooterBuilder(); footer.IconUrl = "http://1000logos.net/wp-content/uploads/2017/05/Reddit-logo.png"; footer.Text = "Reddit"; e.Timestamp = DateTimeOffset.FromUnixTimeSeconds((long)redditPost.created_utc).DateTime.AddHours(2); e.Footer = footer; try { if (!string.IsNullOrEmpty(redditPost.url) && redditPost.url.Contains(".jpg", StringComparison.CurrentCultureIgnoreCase) || redditPost.url.Contains(".png", StringComparison.CurrentCultureIgnoreCase)) { e.ImageUrl = redditPost.url; } else if (!redditPost.thumbnail.Equals("self") && !redditPost.thumbnail.Equals("default") && !string.IsNullOrEmpty(redditPost.thumbnail)) { e.ImageUrl = redditPost.thumbnail; } } catch (Exception) { e.ImageUrl = null; } e.AddField("Score", redditPost.score, true); /*if (redditPost.media_embed != null && redditPost.media_embed.media_domain_url != null) * e.ImageUrl = (await Module.Information.ConvertToGifAsync(redditPost.media_embed.media_domain_url)).Max5MbGif; * else if (redditPost.media != null && redditPost.media.reddit_video != null) * e.ImageUrl = (await Module.Information.ConvertToGifAsync(redditPost.media.reddit_video.fallback_url)).Max5MbGif; */ return(e.Build()); }
private void SystemTimer_Tick(object sender, EventArgs e) { byte chr; int value; Address4.Value(Computer.Address[3]); Address3.Value(Computer.Address[2]); Address2.Value(Computer.Address[1]); Address1.Value(Computer.Address[0]); Data2.Value(Computer.Data[1]); Data1.Value(Computer.Data[0]); TapeCounter.Text = Computer.TapeDeck.TapeCounter().ToString(); chr = Computer.TeleType.NextPrintByte(); while (chr != 0) { TeleType.AppendText(((char)chr).ToString()); if (tapePunch.Running) { tapePunch.Punch(chr); } chr = Computer.TeleType.NextPrintByte(); } if (tapeReader.Running) { value = tapeReader.Next(); if (value >= 0) { Computer.TeleType.Send((byte)value); } } if (Computer.cpu.Debug && !Computer.cpu.NextStep && !singleStepRead) { DebugA.Text = Computer.cpu.ac.ToString("X2"); DebugX.Text = Computer.cpu.x.ToString("X2"); DebugY.Text = Computer.cpu.y.ToString("X2"); DebugPC.Text = Computer.cpu.pc.ToString("X2"); DebugS.Text = Computer.cpu.sp.ToString("X2"); FlagN.Visible = ((Computer.cpu.flags & 0x80) == 0x80); FlagV.Visible = ((Computer.cpu.flags & 0x40) == 0x40); FlagB.Visible = ((Computer.cpu.flags & 0x10) == 0x10); FlagD.Visible = ((Computer.cpu.flags & 0x08) == 0x08); FlagI.Visible = ((Computer.cpu.flags & 0x04) == 0x04); FlagZ.Visible = ((Computer.cpu.flags & 0x02) == 0x02); FlagC.Visible = ((Computer.cpu.flags & 0x01) == 0x01); DebugOutput.AppendText(Computer.cpu.DebugOutput + "\r\n"); singleStepRead = true; } }
public void Field(object value) { var result = new Data2(value).Eval("Value"); Assert.AreEqual(value, result); }
public void EventInPathRaisesPropertyChangedLevel0() { Data2 newData = new Data2(); newData.Items = new Data3[] { new Data3{Value = 300}, new Data3{Value = 400}, new Data3{Value = 500} }; this.EventHelper(() => { this.Data = new Data1 { Data = newData }; this.PropertyChanged(this, new PropertyChangedEventArgs("Data")); }, 400); }