Exemple #1
0
        public BinaryLogViewModels(BinaryLogDocumentData binaryLogDocument)
        {
            BuildTreeViewItems      = new ObservableCollection <BaseViewModel> ();
            TargetListViewItems     = new ObservableCollection <TargetListViewModel> ();
            TaskListViewItems       = new ObservableCollection <TaskListViewModel> ();
            EvaluationListViewItems = new ObservableCollection <EvaluationListViewModel> ();

            BinaryLogDocument = binaryLogDocument;
        }
        public BinaryLogEditorPane(BinaryLogDocumentData documentData)
        {
            _selectionContainer   = new SelectionContainer(true, true);
            _documentData         = documentData;
            _documentData.Loaded += OnDocumentDataLoaded;
            var logControl = new LogViewControl();

            logControl.AddHandler(TreeView.SelectedItemChangedEvent, (RoutedPropertyChangedEventHandler <object>)SelectionChanged);
            logControl.AddHandler(DataGrid.SelectionChangedEvent, (SelectionChangedEventHandler)GridSelectionChanged);
            logControl.BuildTreeTab.DataContext      = new RootViewModel(_buildTreeViewItems);
            logControl.EvaluationTreeTab.DataContext = new RootViewModel(_evaluationTreeViewItems);
            logControl.TargetsTab.DataContext        = _targetListViewItems;
            logControl.TasksTab.DataContext          = _taskListViewItems;
            logControl.EvaluationTab.DataContext     = _evaluationListViewItems;
            Content = logControl;
        }
Exemple #3
0
        int IVsEditorFactory.CreateEditorInstance(uint vsCreateEditorFlags, string fileName, string physicalView, IVsHierarchy hierarchy, uint itemid, IntPtr existingDocData, out IntPtr docView, out IntPtr docData, out string caption, out Guid commandGuid, out int flags)
        {
            docView     = IntPtr.Zero;
            docData     = IntPtr.Zero;
            caption     = null;
            commandGuid = Guid.Empty;
            flags       = 0;

            var oldCursor = Cursor.Current;

            Cursor.Current = Cursors.WaitCursor;

            try
            {
                if ((vsCreateEditorFlags & (uint)(__VSCREATEEDITORFLAGS.CEF_OPENFILE | __VSCREATEEDITORFLAGS.CEF_SILENT)) == 0)
                {
                    throw new ArgumentException(BinaryLogEditorResources.BadCreateFlags, nameof(vsCreateEditorFlags));
                }

                if (existingDocData != IntPtr.Zero)
                {
                    return(VSConstants.VS_E_INCOMPATIBLEDOCDATA);
                }

                caption = string.Empty;
                var documentData = new BinaryLogDocumentData();
                docData     = Marshal.GetIUnknownForObject(documentData);
                docView     = Marshal.GetIUnknownForObject(new BinaryLogEditorPane(documentData));
                commandGuid = ProjectSystemToolsPackage.BinaryLogEditorUIContextGuid;
            }
            finally
            {
                Cursor.Current = oldCursor;
            }

            return(VSConstants.S_OK);
        }