Esempio n. 1
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;
        }
Esempio n. 2
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;
		}