예제 #1
0
            /// <inheritdoc />
            public string GetText(object item)
            {
                ProblemsViewItemCollection itemCollection = item as ProblemsViewItemCollection;

                if (itemCollection == null)
                {
                    return(null);
                }

                EProblemsViewItemType itemType = itemCollection.Kind;

                if (itemType == EProblemsViewItemType.Error)
                {
                    return(Messages.ProblemsViewItemType_Error);
                }
                if (itemType == EProblemsViewItemType.Warning)
                {
                    return(Messages.ProblemsViewItemType_Warning);
                }
                if (itemType == EProblemsViewItemType.Info)
                {
                    return(Messages.ProblemsViewItemType_Info);
                }

                return(itemType.ToString());
            }
예제 #2
0
            /// <inheritdoc />
            public object[] GetChildren(object item)
            {
                ProblemsViewItemCollection itemCollection = item as ProblemsViewItemCollection;

                if (itemCollection == null)
                {
                    return(new object[0]);
                }
                return(itemCollection.ToArray());
            }
예제 #3
0
        /// <summary>
        /// Is invoked when an observed <see cref="IProblemsViewItemProvider"/> raised an event
        /// that he has been found some items.
        /// </summary>
        /// <param name="sender">Event sender</param>
        /// <param name="eventArgs">Event arguments</param>
        private void OnItemProviderItemsFound(object sender, ItemsFoundEventArgs eventArgs)
        {
            if (eventArgs == null)
            {
                return;
            }
            IEnumerable <ProblemsViewItem> items = eventArgs.Items;

            if (items == null)
            {
                return;
            }

            _errorCollection.Clear();
            _warningCollection.Clear();
            _infoCollection.Clear();

            for (IEnumerator <ProblemsViewItem> itr = items.GetEnumerator(); itr.MoveNext();)
            {
                ProblemsViewItem           item       = itr.Current;
                ProblemsViewItemCollection collection = _errorCollection;

                if (item.ItemType == EProblemsViewItemType.Warning)
                {
                    collection = _warningCollection;
                }
                else if (item.ItemType == EProblemsViewItemType.Info)
                {
                    collection = _infoCollection;
                }

                collection.Add(item);
            }

            _dataChanged.Set(true);
        }