Пример #1
0
        DocumentTabService(IDocumentTabUIContextLocatorProvider documentTabUIContextLocatorProvider, DocumentTreeView documentTreeView, ITabServiceProvider tabServiceProvider, IDocumentTabContentFactoryService documentTabContentFactoryService, IDocumentTabServiceSettings documentTabServiceSettings, IWpfFocusService wpfFocusService, IDecompilationCache decompilationCache, [ImportMany] IEnumerable <Lazy <IReferenceDocumentTabContentProvider, IReferenceDocumentTabContentProviderMetadata> > referenceDocumentTabContentProviders, [ImportMany] IEnumerable <Lazy <IDefaultDocumentTabContentProvider, IDefaultDocumentTabContentProviderMetadata> > defaultDocumentTabContentProviders, [ImportMany] IEnumerable <Lazy <IReferenceHandler, IReferenceHandlerMetadata> > referenceHandlers)
        {
            Settings = documentTabServiceSettings;
            this.documentTabUIContextLocatorProvider = documentTabUIContextLocatorProvider;
            this.documentTabContentFactoryService    = documentTabContentFactoryService;
            this.wpfFocusService    = wpfFocusService;
            this.decompilationCache = decompilationCache;
            this.referenceDocumentTabContentProviders = referenceDocumentTabContentProviders.OrderBy(a => a.Metadata.Order).ToArray();
            this.defaultDocumentTabContentProviders   = defaultDocumentTabContentProviders.OrderBy(a => a.Metadata.Order).ToArray();
            this.referenceHandlers = referenceHandlers.OrderBy(a => a.Metadata.Order).ToArray();
            var tvElem = documentTreeView.TreeView.UIObject;

            tvElem.IsVisibleChanged += TreeView_IsVisibleChanged;
            isTreeViewVisible        = tvElem.IsVisible;
            DocumentTreeView         = documentTreeView;
            DocumentTreeView.DocumentService.CollectionChanged += DocumentService_CollectionChanged;
            DocumentTreeView.SelectionChanged     += DocumentTreeView_SelectionChanged;
            DocumentTreeView.NodesTextChanged     += DocumentTreeView_NodesTextChanged;
            DocumentTreeView.NodeActivated        += DocumentTreeView_NodeActivated;
            DocumentTreeView.TreeView.NodeRemoved += TreeView_NodeRemoved;
            tabService      = tabServiceProvider.Create();
            TabGroupService = tabService.Create(new TabGroupServiceOptions(MenuConstants.GUIDOBJ_DOCUMENTS_TABCONTROL_GUID));
            TabGroupService.TabSelectionChanged      += TabGroupService_TabSelectionChanged;
            TabGroupService.TabGroupSelectionChanged += TabGroupService_TabGroupSelectionChanged;
        }
Пример #2
0
 public TabService(IMenuService menuService, IWpfFocusService wpfFocusService)
 {
     this.menuService      = menuService;
     this.wpfFocusService  = wpfFocusService;
     this.tabGroupServices = new List <TabGroupService>();
     this.selectedIndex    = -1;
 }
Пример #3
0
 public TabService(IThemeService themeService, IMenuService menuService, IWpfFocusService wpfFocusService)
 {
     themeService.ThemeChanged += ThemeService_ThemeChanged;
     this.menuService           = menuService;
     this.wpfFocusService       = wpfFocusService;
     this.tabGroupServices      = new List <TabGroupService>();
     this.selectedIndex         = -1;
 }
Пример #4
0
 public TabGroupService(TabService tabService, IMenuService menuService, IWpfFocusService wpfFocusService, TabGroupServiceOptions options)
 {
     this.options              = (options ?? new TabGroupServiceOptions()).Clone();
     stackedContent            = new StackedContent <TabGroup>();
     tabSelectionChanged       = new WeakEventList <TabSelectedEventArgs>();
     tabGroupSelectionChanged  = new WeakEventList <TabGroupSelectedEventArgs>();
     tabGroupCollectionChanged = new WeakEventList <TabGroupCollectionChangedEventArgs>();
     this.tabService           = tabService;
     this.menuService          = menuService;
     this.wpfFocusService      = wpfFocusService;
     _activeIndex              = -1;
 }
Пример #5
0
 public TabGroup(TabGroupService tabGroupService, IMenuService menuService, IWpfFocusService wpfFocusService, TabGroupServiceOptions options)
 {
     this.options                = options;
     this.tabContentAttached     = new WeakEventList <TabContentAttachedEventArgs>();
     this.tabGroupService        = tabGroupService;
     this.wpfFocusService        = wpfFocusService;
     this.tabControl             = new TabControl();
     this.tabControl.DataContext = this;
     this.tabControl.SetStyle(options.TabControlStyle ?? "FileTabGroupTabControlStyle");
     this.tabControl.SelectionChanged += TabControl_SelectionChanged;
     this.tabControl.PreviewKeyDown   += TabControl_PreviewKeyDown;
     if (options.InitializeContextMenu != null)
     {
         this.contextMenuProvider = options.InitializeContextMenu(menuService, this, this.tabControl);
     }
     else if (options.TabGroupGuid != Guid.Empty)
     {
         this.contextMenuProvider = menuService.InitializeContextMenu(this.tabControl, options.TabGroupGuid, new GuidObjectsProvider(this));
     }
 }
Пример #6
0
 TabServiceProvider(IMenuService menuService, IWpfFocusService wpfFocusService)
 {
     this.menuService     = menuService;
     this.wpfFocusService = wpfFocusService;
 }
Пример #7
0
		public TabService(IMenuService menuService, IWpfFocusService wpfFocusService) {
			this.menuService = menuService;
			this.wpfFocusService = wpfFocusService;
			tabGroupServices = new List<TabGroupService>();
			selectedIndex = -1;
		}
Пример #8
0
		public TabGroup(TabGroupService tabGroupService, IMenuService menuService, IWpfFocusService wpfFocusService, TabGroupServiceOptions options) {
			this.options = options;
			tabContentAttached = new WeakEventList<TabContentAttachedEventArgs>();
			this.tabGroupService = tabGroupService;
			this.wpfFocusService = wpfFocusService;
			tabControl = new TabControl();
			tabControl.DataContext = this;
			tabControl.SetStyle(options.TabControlStyle ?? "FileTabGroupTabControlStyle");
			tabControl.SelectionChanged += TabControl_SelectionChanged;
			tabControl.PreviewKeyDown += TabControl_PreviewKeyDown;
			if (options.InitializeContextMenu != null)
				contextMenuProvider = options.InitializeContextMenu(menuService, this, tabControl);
			else if (options.TabGroupGuid != Guid.Empty)
				contextMenuProvider = menuService.InitializeContextMenu(tabControl, options.TabGroupGuid, new GuidObjectsProvider(this));
		}
Пример #9
0
		TabServiceProvider(IMenuService menuService, IWpfFocusService wpfFocusService) {
			this.menuService = menuService;
			this.wpfFocusService = wpfFocusService;
		}
Пример #10
0
		public TabGroupService(TabService tabService, IMenuService menuService, IWpfFocusService wpfFocusService, TabGroupServiceOptions options) {
			this.options = (options ?? new TabGroupServiceOptions()).Clone();
			stackedContent = new StackedContent<TabGroup>();
			tabSelectionChanged = new WeakEventList<TabSelectedEventArgs>();
			tabGroupSelectionChanged = new WeakEventList<TabGroupSelectedEventArgs>();
			tabGroupCollectionChanged = new WeakEventList<TabGroupCollectionChangedEventArgs>();
			this.tabService = tabService;
			this.menuService = menuService;
			this.wpfFocusService = wpfFocusService;
			_activeIndex = -1;
		}