public override void Serialize(XmlDocument dom, XmlElement node) { // node.SetAttribute("type", GetTypeID()); node.SetAttribute("x", this.Bounds.X.ToString()); node.SetAttribute("y", this.Bounds.Y.ToString()); node.SetAttribute("width", this.Bounds.Width.ToString()); node.SetAttribute("height", this.Bounds.Height.ToString()); if (CustomWidth.HasValue) { node.SetAttribute("custom_width", CustomWidth.Value.ToString()); } if (CustomHeight.HasValue) { node.SetAttribute("custom_height", CustomHeight.Value.ToString()); } node.SetAttribute("align", Alignment.ToString()); node.SetAttribute("hyperlink", Hyperlink); node.SetAttribute("display_index", DisplayIndex.ToString()); node.SetAttribute("padding", Padding.ToString()); if (!string.IsNullOrEmpty(Text)) { ST.WriteTextNode(node, "text", Text); } }
private void button2_Click(object sender, EventArgs e) { if (DisplayIndex < QueryResult.Count - 1) { DisplayIndex++; DisplaySituation(); } counterLabel.Text = DisplayIndex.ToString() + "/" + QueryResult.Count.ToString(); }
//Buttons 1 and 2 are for seeing next/prev suggestion private void button1_Click(object sender, System.EventArgs e) { if (DisplayIndex > 0) { DisplayIndex--; DisplaySituation(); } counterLabel.Text = DisplayIndex.ToString() + "/" + QueryResult.Count.ToString(); }
public override string ToString() { StringBuilder overRideString = new StringBuilder(); overRideString.AppendLine("DisplayIndex" + DisplayIndex.ToString()); overRideString.AppendLine("Width" + Width.ToString()); overRideString.AppendLine("Visible" + Visible.ToString()); overRideString.AppendLine("ColumnIndex" + ColumnIndex.ToString()); return(overRideString.ToString()); }
public void DisplaySituation() { CurrentSituation.Clear(); List <int> temp = new List <int>(); if (QueryResult != null && QueryResult.Count != 0) { counterLabel.Text = DisplayIndex.ToString() + "/" + QueryResult.Count.ToString(); foreach (var list in QueryResult[DisplayIndex]) { temp.AddRange(list); } //temp.Add(); //temp.Add(temp.Min() - 2); //temp.Add(temp.Max() + 1); //temp.Add(temp.Max() + 2); ////bleh temp.Sort(); Hits = temp; CurrentSituation.Add(LuceneService.RetrieveMessageById(temp.Min() - 2)); CurrentSituation.Add(LuceneService.RetrieveMessageById(temp.Min() - 1)); for (int i = temp[0]; i <= temp[temp.Count - 1]; i++) { CurrentSituation.Add(LuceneService.RetrieveMessageById(i)); } CurrentSituation.Add(LuceneService.RetrieveMessageById(temp.Max() + 1)); CurrentSituation.Add(LuceneService.RetrieveMessageById(temp.Max() + 2)); suggesterView.SetObjects(CurrentSituation); SetUpChatView(); suggesterView.Sort(suggesterView.AllColumns.Find(x => x.Text.Equals(ProjectInfo.DateFieldKey)), SortOrder.Ascending); } if (QueryResult == null) { MessageBox.Show("Incorrect query"); } if (QueryResult != null && QueryResult.Count == 0) { MessageBox.Show("Nothing found"); } }
public Dictionary <string, string> ToDictionary() { var msg = new Dictionary <string, string> { { "displayEnabled", DisplayEnabled ? "true" : "false" }, { "firstboot", FirstBoot ? "true" : "false" }, { "displayIndex", DisplayIndex.ToString() }, { "hwselftest", HwSelfTest ? "true" : "false" } }; for (var i = 0; i < BusConfig.Length; i++) { msg.Add("Bus " + (i + 1) + " config", BusConfig[i].ToString()); } for (var i = 0; i < Pid.Length; i++) { msg.Add("PID " + (i + 1), Pid[i].ToString()); } return(msg); }