Esempio n. 1
0
        public BindingPane(Telemetry telemetry)
            : base(null)
        {
            StringCache stringCache = new StringCache();

            this.telemetry               = telemetry;
            this.bindingParser           = new BindingEntryParser(stringCache);
            this.viewModel               = new BindingPaneViewModel(telemetry, stringCache);
            this.cancellationTokenSource = new CancellationTokenSource();
            this.Caption = Resource.ToolWindow_Title;
        }
        public BindingPane(BindingPackage package)
            : base(null)
        {
            this.package                 = package;
            this.outputParsers           = new List <IOutputParser>();
            this.viewModel               = new BindingPaneViewModel(package.Telemetry, this.outputParsers);
            this.control                 = new BindingPaneControl(this.package, this.viewModel);
            this.controller              = new BindingPaneController(package, this.viewModel, this.control.TableControl);
            this.cancellationTokenSource = new CancellationTokenSource();

            this.Caption = Resource.ToolWindow_Title;
            this.Content = this.control;
            this.ToolBarCommandTarget = this.controller;
            this.ToolBarLocation      = (int)VSTWT_LOCATION.VSTWT_TOP;
            this.ToolBar = new CommandID(Constants.GuidBindingPaneCommandSet, Constants.BindingPaneToolbarId);
        }
Esempio n. 3
0
        public BindingPaneControl(IServiceProvider serviceProvider, BindingPaneViewModel viewModel)
        {
            IComponentModel          componentModel       = serviceProvider.GetService <SComponentModel, IComponentModel>();
            ITableManagerProvider    tableManagerProvider = componentModel.GetService <ITableManagerProvider>();
            IWpfTableControlProvider tableControlProvider = componentModel.GetService <IWpfTableControlProvider>();

            this.ViewModel       = viewModel;
            this.tableDataSource = new TableDataSource(this.ViewModel.Entries);
            this.tableManager    = tableManagerProvider.GetTableManager(Constants.TableManagerString);
            this.tableManager.AddSource(this.tableDataSource, ColumnNames.DefaultSet.ToArray());
            this.TableControl = tableControlProvider.CreateControl(this.tableManager, true,
                                                                   ColumnNames.DefaultSet.Select(n => new ColumnState2(n, isVisible: true, width: 0)),
                                                                   ColumnNames.DefaultSet.ToArray());

            this.InitializeComponent();

            this.tableHolder.Child = this.TableControl.Control;
        }
        public BindingPaneController(IServiceProvider serviceProvider, BindingPaneViewModel viewModel, IWpfTableControl table)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            this.serviceProvider            = serviceProvider;
            this.shell                      = this.serviceProvider.GetService <SVsUIShell, IVsUIShell>();
            this.viewModel                  = viewModel;
            this.viewModel.PropertyChanged += this.OnViewModelPropertyChanged;
            this.table                      = table;
            this.table.Control.Tag          = this;
            this.traceLevelDisplayNames     = Resource.TraceLevels.Split(',');

            this.traceLevels = new string[]
            {
                nameof(SourceLevels.Off),
                nameof(SourceLevels.Critical),
                nameof(SourceLevels.Error),
                nameof(SourceLevels.Warning),
                nameof(SourceLevels.Information),
                nameof(SourceLevels.Verbose),
                nameof(SourceLevels.ActivityTracing),
                nameof(SourceLevels.All),
            };
        }
 public BindingPaneControl(BindingPaneViewModel viewModel)
 {
     this.ViewModel = viewModel;
     this.InitializeComponent();
 }