public GroupingProviderChainControl(IssueGroup rootGroup, IEnumerable<Type> providers)
		{
			this.RootGroupingProvider = new GroupingProvider (rootGroup);
			availableProviders = providers.ToList();
			
			BuildUi ();
		}
예제 #2
0
        public GroupingProviderChainControl(IssueGroup rootGroup, IEnumerable <Type> providers)
        {
            this.RootGroupingProvider = new GroupingProvider(rootGroup);
            availableProviders        = providers.ToList();

            BuildUi();
        }
예제 #3
0
        public CodeIssuePadControl()
        {
            var buttonRow = new HBox();

            runButton.Clicked += StartAnalyzation;
            buttonRow.PackStart(runButton);

            cancelButton.Clicked  += StopAnalyzation;
            cancelButton.Sensitive = false;
            buttonRow.PackStart(cancelButton);

            var groupingProvider = new CategoryGroupingProvider {
                Next = new ProviderGroupingProvider()
            };

            rootGroup = new IssueGroup(groupingProvider, "root group");
            var groupingProviderControl = new GroupingProviderChainControl(rootGroup, groupingProviders);

            buttonRow.PackStart(groupingProviderControl);

            PackStart(buttonRow);

            store               = new TreeStore(textField, nodeField);
            view.DataSource     = store;
            view.HeadersVisible = false;
            view.Columns.Add("Name", textField);
            view.SelectionMode = SelectionMode.Multiple;

            view.RowActivated   += OnRowActivated;
            view.RowExpanding   += OnRowExpanding;
            view.ButtonPressed  += HandleButtonPressed;
            view.ButtonReleased += HandleButtonReleased;
            PackStart(view, true);

            IIssueTreeNode node = rootGroup;

            node.ChildrenInvalidated += (sender, group) => {
                Application.Invoke(delegate {
                    ClearSiblingNodes(store.GetFirstNode());
                    store.Clear();
                    SyncStateToUi(runner.State);
                    foreach (var child in ((IIssueTreeNode)rootGroup).Children)
                    {
                        var navigator = store.AddNode();
                        SetNode(navigator, child);
                        SyncNode(navigator);
                    }
                });
            };
            node.ChildAdded += HandleRootChildAdded;

            runner.IssueSink             = rootGroup;
            runner.AnalysisStateChanged += HandleAnalysisStateChanged;
        }
예제 #4
0
		public CodeIssuePadControl ()
		{
			var buttonRow = new HBox();
			runButton.Clicked += StartAnalyzation;
			buttonRow.PackStart (runButton);
			
			cancelButton.Clicked += StopAnalyzation;
			cancelButton.Sensitive = false;
			buttonRow.PackStart (cancelButton);
			
			var groupingProvider = new CategoryGroupingProvider {
				Next = new ProviderGroupingProvider()
			};
			rootGroup = new IssueGroup (groupingProvider, "root group");
			var groupingProviderControl = new GroupingProviderChainControl (rootGroup, groupingProviders);
			buttonRow.PackStart (groupingProviderControl);
			
			PackStart (buttonRow);

			store = new TreeStore (textField, nodeField);
			view.DataSource = store;
			view.HeadersVisible = false;
			view.Columns.Add ("Name", textField);
			view.SelectionMode = SelectionMode.Multiple;
			
			view.RowActivated += OnRowActivated;
			view.RowExpanding += OnRowExpanding;
			view.ButtonPressed += HandleButtonPressed;
			view.ButtonReleased += HandleButtonReleased;
			PackStart (view, true);
			
			IIssueTreeNode node = rootGroup;
			node.ChildrenInvalidated += (sender, group) => {
				Application.Invoke (delegate {
					ClearSiblingNodes (store.GetFirstNode ());
					store.Clear ();
					SyncStateToUi (runner.State);
					foreach(var child in ((IIssueTreeNode)rootGroup).Children) {
						var navigator = store.AddNode ();
						SetNode (navigator, child);
						SyncNode (navigator);
					}
				});
			};
			node.ChildAdded += HandleRootChildAdded;
			
			runner.IssueSink = rootGroup;
			runner.AnalysisStateChanged += HandleAnalysisStateChanged;
		}
예제 #5
0
        public IssueGroup GetIssueGroup(IssueSummary issue)
        {
            IssueGroup group;
            var        providerCategory = GetGroupingKey(issue);

            if (providerCategory == null)
            {
                return(null);
            }
            if (!groups.TryGetValue(providerCategory, out group))
            {
                group = new IssueGroup(Next, GetGroupName(issue));
                groups.Add(providerCategory, group);
            }
            return(group);
        }
        public IssueGroup GetIssueGroup(IssueGroup parentGroup, IssueSummary issue)
        {
            IssueGroup group;
            var        providerCategory = GetGroupingKey(issue);

            if (providerCategory == null)
            {
                return(null);
            }
            var key = Tuple.Create(parentGroup, providerCategory);

            if (!groups.TryGetValue(key, out group))
            {
                group = new IssueGroup(Next, GetGroupName(issue));
                groups.Add(key, group);
            }
            return(group);
        }
예제 #7
0
        bool ProcessIssue(IssueSummary issue, out IssueGroup group)
        {
            bool groupAdded = false;

            group = null;
            if (groupingProvider != null)
            {
                group = groupingProvider.GetIssueGroup(issue);
            }
            if (group == null)
            {
                children.Add(issue);
            }
            else if (!groups.Contains(group))
            {
                groupAdded = true;
                groups.Add(group);
                children.Add(group);
            }
            return(groupAdded);
        }
예제 #8
0
        public void AddIssue(IssueSummary issue)
        {
            IssueGroup group      = null;
            bool       groupAdded = false;
            bool       issueAdded = false;

            lock (_lock) {
                if (!allIssues.Contains(issue))
                {
                    IssueCount++;
                    allIssues.Add(issue);
                    ((IIssueTreeNode)issue).VisibleChanged += HandleVisibleChanged;
                    issueAdded = true;
                }
                if (processingEnabled)
                {
                    groupAdded = ProcessIssue(issue, out group);
                }
            }
            if (issueAdded)
            {
                OnTextChanged(new IssueGroupEventArgs(this));
            }
            if (!processingEnabled)
            {
                return;
            }
            if (groupAdded)
            {
                OnChildAdded(new IssueTreeNodeEventArgs(this, group));
            }
            else if (group == null)
            {
                OnChildAdded(new IssueTreeNodeEventArgs(this, issue));
            }
            if (group != null)
            {
                group.AddIssue(issue);
            }
        }
예제 #9
0
		public IssueGroup GetIssueGroup (IssueGroup parent, IssueSummary issue)
		{
			return null;
		}
예제 #10
0
 public GroupingProvider(IssueGroup rootGroup)
 {
     this.rootGroup = rootGroup;
     next           = rootGroup.GroupingProvider;
 }
			public GroupingProvider (IssueGroup rootGroup)
			{
				this.rootGroup = rootGroup;
				next = rootGroup.GroupingProvider;
			}
예제 #12
0
		bool ProcessIssue (IssueSummary issue, out IssueGroup group)
		{
			bool groupAdded = false;
			group = null;
			if (groupingProvider != null) {
				group = groupingProvider.GetIssueGroup (issue);
			}
			if (group == null) {
				children.Add (issue);
			} else if (!groups.Contains (group)) {
				groupAdded = true;
				groups.Add (group);
				children.Add (group);
			}
			return groupAdded;
		}
예제 #13
0
 public IssueGroup GetIssueGroup(IssueGroup parent, IssueSummary issue)
 {
     return(null);
 }
			public IssueGroup GetIssueGroup (IssueGroup parent, IssueSummary issue)
			{
				throw new NotImplementedException ();
			}
 public IssueGroup GetIssueGroup(IssueGroup parent, IssueSummary issue)
 {
     throw new NotImplementedException();
 }
예제 #16
0
		public IssueGroup GetIssueGroup (IssueGroup parent, IssueSummary issue)
		{
			GetIssueGroupCalled = true;
			return Group;
		}