示例#1
0
        public object CreateToolTip(ControlsTranslation translation)
        {
            if (node.IsThread)
            {
                return(Name);                // only name for threads
            }
            TextBlock text = new TextBlock
            {
                Inlines =
                {
                    ((!string.IsNullOrEmpty(node.ReturnType)) ? node.ReturnType + " " : ""),
                    new Bold {
                        Inlines = { node.Name }
                    },
                    "(" + ((node.Parameters.Count > 0) ? string.Join(", ",                  node.Parameters.ToArray()) : "") + ")\n",
                    new Bold {
                        Inlines = { translation.CpuCyclesText }
                    },
                    " " + node.CpuCyclesSpent + "\n",
                    new Bold {
                        Inlines = { translation.TimeText }
                    },
                    " " + node.TimeSpent.ToString("f6") + "ms\n",
                    new Bold {
                        Inlines = { translation.CallsText }
                    },
                    " " + node.CallCount.ToString()
                }
            };

            return(text);
        }
        public QueryView()
        {
            InitializeComponent();
            this.IsVisibleChanged += delegate { this.ExecuteQuery(); };
            this.DataContext       = this;
            this.task              = new SingleTask(this.Dispatcher);
            this.searchTask        = new SingleTask(this.Dispatcher);

            this.Translation = new ControlsTranslation();
            this.visibleColumnsSelection.ItemsSource = this.gridView.Columns.Select(col => new GridViewColumnModel(col));

            this.treeView.SizeChanged += QueryView_SizeChanged;
        }
示例#3
0
        public QueryView()
        {
            InitializeComponent();
            this.IsVisibleChanged += delegate { this.ExecuteQuery(); };
            this.DataContext       = this;
            this.task              = new SingleTask(this.Dispatcher);
            this.searchTask        = new SingleTask(this.Dispatcher);

            this.Translation = new ControlsTranslation();

            this.treeView.SizeChanged += delegate(object sender, SizeChangedEventArgs e) {
                if (e.NewSize.Width > 0 && e.PreviousSize.Width > 0)
                {
                    double adjustedNameColumnWidth = nameColumn.Width + e.NewSize.Width - e.PreviousSize.Width;
                    double matchingNameColumnWidth = e.NewSize.Width - this.callCountColumn.Width
                                                     - this.percentColumn.Width - this.timeSpentColumn.Width
                                                     - this.timeSpentSelfColumn.Width - this.timeSpentPerCallColumn.Width
                                                     - this.timeSpentSelfPerCallColumn.Width - 25;

                    // always keep name column at least 75 pixels wide
                    if (matchingNameColumnWidth < 75)
                    {
                        matchingNameColumnWidth = 75;
                    }

                    if (e.NewSize.Width >= e.PreviousSize.Width)
                    {
                        // treeView got wider: also make name column wider if there's space free
                        if (adjustedNameColumnWidth <= matchingNameColumnWidth)
                        {
                            nameColumn.Width = adjustedNameColumnWidth;
                        }
                    }
                    else
                    {
                        // treeView got smaller: make column smaller unless there's space free
                        if (adjustedNameColumnWidth >= matchingNameColumnWidth)
                        {
                            nameColumn.Width = adjustedNameColumnWidth;
                        }
                    }
                }
            };
        }
示例#4
0
		public QueryView()
		{
			InitializeComponent();
			this.IsVisibleChanged += delegate { this.ExecuteQuery(); };
			this.DataContext = this;
			this.task = new SingleTask(this.Dispatcher);
			this.searchTask = new SingleTask(this.Dispatcher);
			
			this.Translation = new ControlsTranslation();
			this.visibleColumnsSelection.ItemsSource = this.gridView.Columns.Select(col => new GridViewColumnModel(col));
			
			this.treeView.SizeChanged += QueryView_SizeChanged;
		}
示例#5
0
 public RingDiagramControl()
 {
     this.hierarchyStack = new Stack <CallTreeNodeViewModel>();
     this.task           = new SingleTask(this.Dispatcher);
     this.Translation    = new ControlsTranslation();
 }
示例#6
0
		public RingDiagramControl()
		{
			this.hierarchyStack = new Stack<CallTreeNodeViewModel>();
			this.task = new SingleTask(this.Dispatcher);
			this.Translation = new ControlsTranslation();
		}
		public QueryView()
		{
			InitializeComponent();
			this.IsVisibleChanged += delegate { this.ExecuteQuery(); };
			this.DataContext = this;
			this.task = new SingleTask(this.Dispatcher);
			this.searchTask = new SingleTask(this.Dispatcher);
			
			this.Translation = new ControlsTranslation();
			
			this.treeView.SizeChanged += delegate(object sender, SizeChangedEventArgs e) {
				if (e.NewSize.Width > 0 && e.PreviousSize.Width > 0) {
					double adjustedNameColumnWidth = nameColumn.Width + e.NewSize.Width - e.PreviousSize.Width;
					double matchingNameColumnWidth = e.NewSize.Width - this.callCountColumn.Width
						- this.percentColumn.Width - this.timeSpentColumn.Width
						- this.timeSpentSelfColumn.Width - this.timeSpentPerCallColumn.Width
						- this.timeSpentSelfPerCallColumn.Width - 25;
					
					// always keep name column at least 75 pixels wide
					if (matchingNameColumnWidth < 75)
						matchingNameColumnWidth = 75;
					
					if (e.NewSize.Width >= e.PreviousSize.Width) {
						// treeView got wider: also make name column wider if there's space free
						if (adjustedNameColumnWidth <= matchingNameColumnWidth)
							nameColumn.Width = adjustedNameColumnWidth;
					} else {
						// treeView got smaller: make column smaller unless there's space free
						if (adjustedNameColumnWidth >= matchingNameColumnWidth)
							nameColumn.Width = adjustedNameColumnWidth;
					}
				}
			};
		}