Пример #1
0
        private void dataGridView1_DoubleClick(object sender, EventArgs e)
        {
            //dataGridView1.CurrentRow.Cells["TagDesc"].Value.ToString();
            HistoryLines m_frmHistoryLines = new HistoryLines(UnitNO);

            m_frmHistoryLines.labelTag.TagID   = int.Parse(dataGridView1.CurrentRow.Cells["ID"].Value.ToString());
            m_frmHistoryLines.labelTag.TagDesc = dataGridView1.CurrentRow.Cells["TagDesc"].Value.ToString();
            m_frmHistoryLines.Show();
        }
Пример #2
0
        public void LoadConfig(XDocument xDoc)
        {
            HistoryLines.Clear();

            var xHistory = xDoc.Descendants(XName.Get("History")).FirstOrDefault();

            if (xHistory != null)
            {
                foreach (var xHistoryLine in xHistory.Elements(XName.Get("HistoryLine")))
                {
                    var      xAttrText = xHistoryLine.Attribute(XName.Get("Text"));
                    var      xAttrDate = xHistoryLine.Attribute(XName.Get("Date"));
                    DateTime date;
                    if (xAttrText != null &&
                        xAttrDate != null &&
                        DateTime.TryParse(xAttrDate.Value, out date))
                    {
                        HistoryLines.Add(new ConsoleHistoryLine(this, xAttrText.Value, date));
                    }
                }
            }

            mHistoryLineCurrIdx = HistoryLines.Count;
        }
Пример #3
0
 public void AddToHistory(string text)
 {
     HistoryLines.Add(new ConsoleHistoryLine(this, text, DateTime.Now));
     mHistoryLineCurrIdx = HistoryLines.Count;
 }