Ejemplo n.º 1
0
            /// <inheritdoc />
            public string GetText(object element, ColumnDescriptor column)
            {
                ProblemsViewItem item = element as ProblemsViewItem;

                if (item == null)
                {
                    return(null);
                }
                if (column == ProblemsViewListContentProvider.DescriptionColumn)
                {
                    return(item.Description);
                }
                if (column == ProblemsViewListContentProvider.LineColumn)
                {
                    return(item.Line.ToString());
                }
                if (column == ProblemsViewListContentProvider.ColumnColumn)
                {
                    return(item.Column.ToString());
                }
                if (column == ProblemsViewListContentProvider.FileColumn)
                {
                    Uri location = item.WorkspaceArtefact.Location;
                    return(location == null ? string.Empty : location.LocalPath.Split('\\').Last());
                }

                return(null);
            }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        /// <inheritdoc />
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }
            ProblemsViewItem item = obj as ProblemsViewItem;

            if (item == null)
            {
                return(false);
            }

            if (!Equals(ItemType, item.ItemType))
            {
                return(false);
            }
            if (!Equals(WorkspaceArtefact, item.WorkspaceArtefact))
            {
                return(false);
            }
            if (!Equals(Line, item.Line))
            {
                return(false);
            }
            if (!Equals(Column, item.Column))
            {
                return(false);
            }
            if (!Equals(Description, item.Description))
            {
                return(false);
            }

            return(true);
        }