public ProfilerView(ProfilingDataProvider provider)
		{
			InitializeComponent();
			
			this.provider = provider;
			
			this.timeLine.IsEnabled = true;
			this.timeLine.Provider = provider;
			this.timeLine.SelectedStartIndex = 0;
			this.timeLine.SelectedEndIndex = provider.DataSets.Count - 1;
			
			var translation = new SharpDevelopTranslation();
			
			foreach (TabItem item in this.tabView.Items) {
				if (item.Content != null) {
					QueryView view = item.Content as QueryView;
					view.Reporter = new ErrorReporter(UpdateErrorList);
					view.Provider = provider;
					view.Translation = translation;
					view.SetRange(this.timeLine.SelectedStartIndex, this.timeLine.SelectedEndIndex);
					view.ContextMenuOpening += delegate(object sender, ContextMenuEventArgs e) {
						object source = (e.OriginalSource is Shape) ? e.OriginalSource : view;
						MenuService.ShowContextMenu(view, source, "/AddIns/Profiler/QueryView/ContextMenu");
					};
				}
			}
			
			this.dummyTab.Header = new Image { Source = PresentationResourceService.GetImage("Icons.16x16.NewDocumentIcon").Source, Height = 16, Width = 16 };
			
			this.CommandBindings.Add(new CommandBinding(ApplicationCommands.SelectAll, ExecuteSelectAll, CanExecuteSelectAll));
			
			InitializeLastItems();
			InitializeOldTabs();
		}
Example #2
0
        public ProfilerView(ProfilingDataProvider provider)
        {
            InitializeComponent();
            this.provider = provider;

            this.timeLine.IsEnabled = true;
            this.timeLine.ValuesList.Clear();
            this.timeLine.ValuesList.AddRange(this.provider.DataSets.Select(i => new TimeLineInfo()
            {
                value = i.CpuUsage / 100, displayMarker = i.IsFirst
            }));
            this.timeLine.SelectedStartIndex = 0;
            this.timeLine.SelectedEndIndex   = this.timeLine.ValuesList.Count;

            var translation = new SharpDevelopTranslation();

            foreach (TabItem item in this.tabView.Items)
            {
                if (item.Content != null)
                {
                    QueryView view = item.Content as QueryView;
                    view.Reporter    = new ErrorReporter(UpdateErrorList);
                    view.Provider    = provider;
                    view.Translation = translation;
                    view.SetRange(this.timeLine.SelectedStartIndex, this.timeLine.SelectedEndIndex);
                    view.ContextMenuOpening += delegate(object sender, ContextMenuEventArgs e) {
                        object source = (e.OriginalSource is Shape) ? e.OriginalSource : view;
                        MenuService.CreateContextMenu(source, "/AddIns/Profiler/QueryView/ContextMenu").IsOpen = true;
                    };
                }
            }

            this.dummyTab.Header = new Image {
                Source = PresentationResourceService.GetImage("Icons.16x16.NewDocumentIcon").Source, Height = 16, Width = 16
            };

            this.CommandBindings.Add(new CommandBinding(ApplicationCommands.SelectAll, ExecuteSelectAll, CanExecuteSelectAll));

            InitializeLastItems();
            InitializeOldTabs();
        }