Example #1
0
 public ToolWindowUI(MainWindowControl mainWindowControl, AppToolWindowLocation location, double length, StackedContent <IStackedContentChild> stackedContent, bool insertLast, IToolWindowGroupService mgr)
 {
     this.mainWindowControl = mainWindowControl;
     Location               = location;
     Length                 = length;
     StackedContent         = stackedContent;
     InsertLast             = insertLast;
     ToolWindowGroupService = mgr;
     ToolWindowGroupService.TabGroupCollectionChanged += ToolWindowGroupService_TabGroupCollectionChanged;
 }
Example #2
0
 public ToolWindowUI(MainWindowControl mainWindowControl, AppToolWindowLocation location, double length, StackedContent <IStackedContentChild> stackedContent, bool insertLast, IToolWindowGroupManager mgr)
 {
     this.mainWindowControl      = mainWindowControl;
     this.Location               = location;
     this.Length                 = length;
     this.StackedContent         = stackedContent;
     this.InsertLast             = insertLast;
     this.ToolWindowGroupManager = mgr;
     ToolWindowGroupManager.TabGroupCollectionChanged += ToolWindowGroupManager_TabGroupCollectionChanged;
 }
Example #3
0
        public void Restore(MainWindowControl mainWindowControl, MainWindowControl.ToolWindowUI ui)
        {
            if (Groups.Count == 0)
            {
                return;
            }

            var mgr = ui.ToolWindowGroupService;

            mgr.IsHorizontal = IsHorizontal;

            foreach (var gs in Groups)
            {
                if (gs.Contents.Count == 0)
                {
                    continue;
                }
                var g = mgr.Create();
                foreach (var cs in gs.Contents)
                {
                    mainWindowControl.TryAdd(ui, g, cs.Guid);
                }
                var cl = g.TabContents.ToList();
                if ((uint)gs.Index < (uint)cl.Count)
                {
                    g.ActiveTabContent = cl[gs.Index];
                }
                else if (cl.Count > 0)
                {
                    g.ActiveTabContent = cl[0];
                }
            }
            mainWindowControl.Show(ui);

            var groups = mgr.TabGroups.ToList();

            if ((uint)Index < (uint)groups.Count)
            {
                mgr.ActiveTabGroup = groups[Index];
            }
            else if (groups.Count > 0)
            {
                mgr.ActiveTabGroup = groups[0];
            }
            ((ToolWindowGroupService)mgr).StackedContentState = this.StackedContentState;
            foreach (var g in groups)
            {
                if (!g.TabContents.Any())
                {
                    mgr.Close(g);
                }
            }
        }
Example #4
0
 AppWindow(ISettingsService settingsService, IDocumentTabService documentTabService, AppToolBar appToolBar, MainWindowControl mainWindowControl, IWpfCommandService wpfCommandService)
 {
     assemblyInformationalVersion = CalculateAssemblyInformationalVersion(GetType().Assembly);
     uiSettings = new UISettings(settingsService);
     uiSettings.Read();
     stackedContent          = new StackedContent <IStackedContentChild>(margin: new Thickness(6));
     this.documentTabService = documentTabService;
     statusBar              = new AppStatusBar();
     this.appToolBar        = appToolBar;
     this.mainWindowControl = mainWindowControl;
     this.wpfCommandService = wpfCommandService;
     mainWindowCommands     = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW);
     mainWindowClosing      = new WeakEventList <CancelEventArgs>();
     mainWindowClosed       = new WeakEventList <EventArgs>();
 }
Example #5
0
 AppWindow(IThemeManager themeManager, IImageManager imageManager, IAppSettings appSettings, ISettingsManager settingsManager, IFileTabManager fileTabManager, AppToolBar appToolBar, MainWindowControl mainWindowControl, IWpfCommandManager wpfCommandManager, IDecompilerManager decompilerManager)
 {
     this.assemblyInformationalVersion = CalculateAssemblyInformationalVersion(GetType().Assembly);
     this.uiSettings = new UISettings(settingsManager);
     this.uiSettings.Read();
     this.appSettings           = appSettings;
     this.stackedContent        = new StackedContent <IStackedContentChild>(margin: new Thickness(6));
     this.themeManager          = themeManager;
     themeManager.ThemeChanged += ThemeManager_ThemeChanged;
     this.imageManager          = imageManager;
     this.fileTabManager        = fileTabManager;
     this.statusBar             = new AppStatusBar();
     this.appToolBar            = appToolBar;
     this.mainWindowControl     = mainWindowControl;
     this.wpfCommandManager     = wpfCommandManager;
     this.decompilerManager     = decompilerManager;
     this.mainWindowCommands    = wpfCommandManager.GetCommands(ControlConstants.GUID_MAINWINDOW);
     this.mainWindowClosing     = new WeakEventList <CancelEventArgs>();
     this.mainWindowClosed      = new WeakEventList <EventArgs>();
 }
Example #6
0
 AppWindow(IThemeManager themeManager, IImageManager imageManager, IAppSettings appSettings, ISettingsManager settingsManager, IFileTabManager fileTabManager, AppToolBar appToolBar, MainWindowControl mainWindowControl, IWpfCommandManager wpfCommandManager, ILanguageManager languageManager)
 {
     this.assemblyInformationalVersion = CalculateAssemblyInformationalVersion(GetType().Assembly);
     this.uiSettings = new UISettings(settingsManager);
     this.uiSettings.Read();
     this.appSettings = appSettings;
     this.stackedContent = new StackedContent<IStackedContentChild>(margin: new Thickness(6));
     this.themeManager = themeManager;
     themeManager.ThemeChanged += ThemeManager_ThemeChanged;
     this.imageManager = imageManager;
     this.fileTabManager = fileTabManager;
     this.statusBar = new AppStatusBar();
     this.appToolBar = appToolBar;
     this.mainWindowControl = mainWindowControl;
     this.wpfCommandManager = wpfCommandManager;
     this.languageManager = languageManager;
     this.mainWindowCommands = wpfCommandManager.GetCommands(CommandConstants.GUID_MAINWINDOW);
     this.mainWindowClosing = new WeakEventList<CancelEventArgs>();
     this.mainWindowClosed = new WeakEventList<EventArgs>();
     this.appSettings.PropertyChanged += AppSettings_PropertyChanged;
     InitializeTextFormatterProvider();
 }
Example #7
0
		AppWindow(ISettingsService settingsService, IDocumentTabService documentTabService, AppToolBar appToolBar, MainWindowControl mainWindowControl, IWpfCommandService wpfCommandService) {
			assemblyInformationalVersion = CalculateAssemblyInformationalVersion(GetType().Assembly);
			uiSettings = new UISettings(settingsService);
			uiSettings.Read();
			stackedContent = new StackedContent<IStackedContentChild>(margin: new Thickness(6));
			this.documentTabService = documentTabService;
			statusBar = new AppStatusBar();
			this.appToolBar = appToolBar;
			this.mainWindowControl = mainWindowControl;
			this.wpfCommandService = wpfCommandService;
			mainWindowCommands = wpfCommandService.GetCommands(ControlConstants.GUID_MAINWINDOW);
			mainWindowClosing = new WeakEventList<CancelEventArgs>();
			mainWindowClosed = new WeakEventList<EventArgs>();
		}
Example #8
0
 public ToolWindowUIState Save(AppToolWindowLocation location, MainWindowControl.ToolWindowUI ui)
 {
     this.Location = location;
     this.StackedContentState = ((ToolWindowGroupManager)ui.ToolWindowGroupManager).StackedContentState;
     var groups = ui.ToolWindowGroupManager.TabGroups.ToList();
     this.Index = groups.IndexOf(ui.ToolWindowGroupManager.ActiveTabGroup);
     this.IsHorizontal = ui.ToolWindowGroupManager.IsHorizontal;
     foreach (var g in groups)
         Groups.Add(new ToolWindowGroupState().Save(g));
     return this;
 }
Example #9
0
        public void Restore(MainWindowControl mainWindowControl, MainWindowControl.ToolWindowUI ui)
        {
            if (Groups.Count == 0)
                return;

            var mgr = ui.ToolWindowGroupManager;
            mgr.IsHorizontal = IsHorizontal;

            foreach (var gs in Groups) {
                if (gs.Contents.Count == 0)
                    continue;
                var g = mgr.Create();
                foreach (var cs in gs.Contents)
                    mainWindowControl.TryAdd(ui, g, cs.Guid);
                var cl = g.TabContents.ToList();
                if ((uint)gs.Index < (uint)cl.Count)
                    g.ActiveTabContent = cl[gs.Index];
            }
            mainWindowControl.Show(ui);

            var groups = mgr.TabGroups.ToList();
            if ((uint)Index < (uint)groups.Count)
                mgr.ActiveTabGroup = groups[Index];
            ((ToolWindowGroupManager)mgr).StackedContentState = this.StackedContentState;
            foreach (var g in groups) {
                if (!g.TabContents.Any())
                    mgr.Close(g);
            }
        }
Example #10
0
 public ToolWindowUI(MainWindowControl mainWindowControl, AppToolWindowLocation location, double length, StackedContent<IStackedContentChild> stackedContent, bool insertLast, IToolWindowGroupManager mgr)
 {
     this.mainWindowControl = mainWindowControl;
     this.Location = location;
     this.Length = length;
     this.StackedContent = stackedContent;
     this.InsertLast = insertLast;
     this.ToolWindowGroupManager = mgr;
     ToolWindowGroupManager.TabGroupCollectionChanged += ToolWindowGroupManager_TabGroupCollectionChanged;
 }
Example #11
0
			public ToolWindowUI(MainWindowControl mainWindowControl, AppToolWindowLocation location, double length, StackedContent<IStackedContentChild> stackedContent, bool insertLast, IToolWindowGroupService mgr) {
				this.mainWindowControl = mainWindowControl;
				Location = location;
				Length = length;
				StackedContent = stackedContent;
				InsertLast = insertLast;
				ToolWindowGroupService = mgr;
				ToolWindowGroupService.TabGroupCollectionChanged += ToolWindowGroupService_TabGroupCollectionChanged;
			}