Exemplo n.º 1
0
        public void UpdateTagsCollection(string tagDisplayName, string tagValue, Dispatcher dispatcher)
        {
            bool tagFound = false;

            dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate()
            {
                foreach (TagInfo summarySignal in _summaryStatusTags)
                {
                    if (summarySignal.TagName.Equals(tagDisplayName))
                    {
                        int index = _summaryStatusTags.IndexOf(summarySignal);

                        _summaryStatusTags.RemoveAt(index);

                        summarySignal.TagName  = tagDisplayName;
                        summarySignal.TagValue = tagValue;
                        _summaryStatusTags.Insert(index, summarySignal);
                        tagFound = true;
                        break;
                    }
                }

                if (!tagFound)
                {
                    TagInfo summarySignal  = new TagInfo();
                    summarySignal.TagValue = tagValue;
                    summarySignal.TagName  = tagDisplayName;
                    _summaryStatusTags.Add(summarySignal);
                }
            }));
        }
Exemplo n.º 2
0
        public void UpdateTagsCollection(string tagDisplayName, string tagValue, Dispatcher dispatcher)
        {
            bool tagFound = false;

            dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate()
            {
                foreach (TagInfo estop in _warningTags)
                {
                    if (estop.TagName.Equals(tagDisplayName))
                    {
                        int index = _warningTags.IndexOf(estop);

                        _warningTags.RemoveAt(index);

                        estop.TagName  = tagDisplayName;
                        estop.TagValue = tagValue;
                        _warningTags.Insert(index, estop);
                        tagFound = true;
                        break;
                    }
                }

                if (!tagFound)
                {
                    TagInfo estop  = new TagInfo();
                    estop.TagValue = tagValue;
                    estop.TagName  = tagDisplayName;
                    _warningTags.Add(estop);
                }
            }));
        }