void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.timeLine = ((ICSharpCode.Profiler.Controls.ExtendedTimeLineControl)(target));

            #line 33 "..\..\..\..\Src\Views\ProfilerView.xaml"
                this.timeLine.RangeChanged += new System.EventHandler <ICSharpCode.Profiler.Controls.RangeEventArgs>(this.TimeLineRangeChanged);

            #line default
            #line hidden
                return;

            case 2:
                this.toolBar1 = ((System.Windows.Controls.ToolBar)(target));
                return;

            case 3:
                this.mnuQueryHistory = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 4:
                this.mnuClearQueryHistory = ((System.Windows.Controls.MenuItem)(target));

            #line 38 "..\..\..\..\Src\Views\ProfilerView.xaml"
                this.mnuClearQueryHistory.Click += new System.Windows.RoutedEventHandler(this.ClearQueryHistoryClick);

            #line default
            #line hidden
                return;

            case 5:
                this.tabView = ((System.Windows.Controls.TabControl)(target));

            #line 43 "..\..\..\..\Src\Views\ProfilerView.xaml"
                this.tabView.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.TabViewSelectionChanged);

            #line default
            #line hidden
                return;

            case 6:
                this.treeView = ((ICSharpCode.Profiler.Controls.QueryView)(target));
                return;

            case 7:
                this.top20View = ((ICSharpCode.Profiler.Controls.QueryView)(target));
                return;

            case 8:
                this.dummyTab = ((System.Windows.Controls.TabItem)(target));
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo n.º 2
0
		void ViewCurrentQueryChanged(TextBlock header, QueryView view)
		{
			header.Text = view.CurrentQuery;
			header.ToolTip = view.CurrentQuery;
			int index;
			while ((index = GetLastMatch(view.CurrentQuery)) != -1)
				mnuQueryHistory.Items.RemoveAt(index);

			MenuItem item = new MenuItem { Header = view.CurrentQuery };

			item.Click += delegate { CreateTab(header.Text, header.Text); };

			mnuQueryHistory.Items.Insert(2, item);

			if (mnuQueryHistory.Items.Count > 12) mnuQueryHistory.Items.RemoveAt(12);
		}
Ejemplo n.º 3
0
		TabItem CreateTab(string title, string query, bool switchToNewTab)
		{
			TabItem newTab = new TabItem();
			Button closeButton = new Button { Style = this.Resources["CloseButton"] as Style };
			TextBlock header = new TextBlock { Margin = new Thickness(0, 0, 4, 0), MaxWidth = 120, MinWidth = 40 };

			newTab.Header = new StackPanel { Orientation = Orientation.Horizontal, Children = { header, closeButton } };

			closeButton.Click += new RoutedEventHandler(CloseButtonClick);
			closeButton.Tag = newTab;

			QueryView view;

			newTab.Content = view = new QueryView();

			view.Provider = this.provider;
			view.Reporter = new ErrorReporter(UpdateErrorList);
			view.SetRange(this.timeLine.SelectedStartIndex, this.timeLine.SelectedEndIndex);
			
			view.CurrentQuery = query;
			view.ShowQueryItems = true;
			view.ContextMenuOpening += delegate(object sender, ContextMenuEventArgs e) {
				object source = (e.OriginalSource is Shape) ? e.OriginalSource : view;
				MenuService.ShowContextMenu(view, source, "/AddIns/Profiler/QueryView/ContextMenu");
			};
			view.CurrentQueryChanged += delegate { ViewCurrentQueryChanged(header, view); };

			header.Text = title;
			header.TextTrimming = TextTrimming.CharacterEllipsis;
			header.TextWrapping = TextWrapping.NoWrap;
			header.ToolTip = title;
			tabView.Items.Insert(tabView.Items.Count - 1, newTab);
			if (switchToNewTab)
				tabView.SelectedItem = newTab;
			
			return newTab;
		}
Ejemplo n.º 4
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.queryView = ((ICSharpCode.Profiler.Controls.QueryView)(target));
                return;

            case 2:
                this.treeView = ((ICSharpCode.Profiler.Controls.TreeListView)(target));
                return;

            case 3:
                this.gridView = ((ICSharpCode.Profiler.Controls.CustomGridView)(target));
                return;

            case 4:
                this.nameColumn = ((System.Windows.Controls.GridViewColumn)(target));
                return;

            case 5:
                this.callCountColumn = ((System.Windows.Controls.GridViewColumn)(target));
                return;

            case 6:
                this.timeSpentColumn = ((System.Windows.Controls.GridViewColumn)(target));
                return;

            case 7:
                this.timeSpentSelfColumn = ((System.Windows.Controls.GridViewColumn)(target));
                return;

            case 8:
                this.timeSpentPerCallColumn = ((System.Windows.Controls.GridViewColumn)(target));
                return;

            case 9:
                this.timeSpentSelfPerCallColumn = ((System.Windows.Controls.GridViewColumn)(target));
                return;

            case 10:
                this.percentColumn = ((System.Windows.Controls.GridViewColumn)(target));
                return;

            case 11:
                this.txtSearch = ((System.Windows.Controls.TextBox)(target));

            #line 336 "..\..\QueryView.xaml"
                this.txtSearch.KeyDown += new System.Windows.Input.KeyEventHandler(this.txtSearchKeyDown);

            #line default
            #line hidden
                return;

            case 12:
                this.btnExpandHotPathSubtree = ((System.Windows.Controls.Button)(target));

            #line 338 "..\..\QueryView.xaml"
                this.btnExpandHotPathSubtree.Click += new System.Windows.RoutedEventHandler(this.BtnExpandHotPathSubtreeClick);

            #line default
            #line hidden
                return;

            case 13:
                this.visibleColumnsSelection = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 14:
                this.queryPanel = ((System.Windows.Controls.DockPanel)(target));
                return;

            case 15:
                this.btnExecuteQuery = ((System.Windows.Controls.Button)(target));

            #line 348 "..\..\QueryView.xaml"
                this.btnExecuteQuery.Click += new System.Windows.RoutedEventHandler(this.btnExecuteQueryClick);

            #line default
            #line hidden
                return;

            case 16:
                this.txtQuery = ((System.Windows.Controls.TextBox)(target));

            #line 349 "..\..\QueryView.xaml"
                this.txtQuery.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.txtQueryTextChanged);

            #line default
            #line hidden

            #line 349 "..\..\QueryView.xaml"
                this.txtQuery.KeyDown += new System.Windows.Input.KeyEventHandler(this.txtQueryKeyDown);

            #line default
            #line hidden
                return;

            case 17:
                this.diagramView = ((System.Windows.Controls.Viewbox)(target));
                return;

            case 18:
                this.ringDiagram = ((ICSharpCode.Profiler.Controls.RingDiagramControl)(target));
                return;
            }
            this._contentLoaded = true;
        }