예제 #1
0
        public void UpdateAnalogOutputTag(AnalogOutputTag tag)
        {
            var item = listViewAO.FindItemWithText(tag.Id);

            item.Tag = tag;
            item.SubItems[1].Text = tag.Description;
            item.SubItems[2].Text = tag.Address;
            item.SubItems[3].Text = tag.LowLimit.ToString(CultureInfo.CurrentCulture);
            item.SubItems[4].Text = tag.HighLimit.ToString(CultureInfo.CurrentCulture);
            item.SubItems[5].Text = tag.Units;
            item.SubItems[6].Text = tag.GetValue().ToString(CultureInfo.CurrentCulture);
        }
예제 #2
0
        public void AddAnalogOutputTag(AnalogOutputTag tag)
        {
            if (listViewAO.FindItemWithText(tag.Id) != null)
            {
                return;
            }
            var item = new ListViewItem(tag.Id)
            {
                Tag = tag
            };

            item.SubItems.Add(tag.Description);
            item.SubItems.Add(tag.Address);
            item.SubItems.Add(tag.LowLimit.ToString(CultureInfo.CurrentCulture));
            item.SubItems.Add(tag.HighLimit.ToString(CultureInfo.CurrentCulture));
            item.SubItems.Add(tag.Units);
            item.SubItems.Add(tag.GetValue().ToString(CultureInfo.CurrentCulture));
            listViewAO.Items.Add(item);
        }