public MPTCheckBox()
 {
     themeManager = ServiceScope.Get<IThemeManager>();
       // Setup message queue for receiving Messages
       IMessageQueue queueMessage = ServiceScope.Get<IMessageBroker>().GetOrCreate("message");
       queueMessage.OnMessageReceive += OnMessageReceive;
 }
 public ThemedViewResultFilter(IThemeManager themeManager, WorkContext workContext, ILayoutAwareViewEngine layoutAwareViewEngine)
 {
     _themeManager = themeManager;
     _workContext = workContext;
     _layoutAwareViewEngine = layoutAwareViewEngine;
     Logger = NullLogger.Instance;
 }
 public MainMenuSettingsViewModel(IThemeManager themeManager)
 {
     _themeManager = themeManager;
     SelectedTheme = themeManager.CurrentTheme;
     AutoHideMainMenu = Properties.Settings.Default.AutoHideMainMenu;
     SelectedLanguage = Properties.Settings.Default.LanguageCode;
 }
        public OutputCacheFilter(
            ICacheManager cacheManager,
            IOutputCacheStorageProvider cacheStorageProvider,
            ITagCache tagCache,
            IDisplayedContentItemHandler displayedContentItemHandler,
            IWorkContextAccessor workContextAccessor,
            IThemeManager themeManager,
            IClock clock,
            ICacheService cacheService,
            ISignals signals,
            ShellSettings shellSettings) {

            _cacheManager = cacheManager;
            _cacheStorageProvider = cacheStorageProvider;
            _tagCache = tagCache;
            _displayedContentItemHandler = displayedContentItemHandler;
            _workContextAccessor = workContextAccessor;
            _themeManager = themeManager;
            _clock = clock;
            _cacheService = cacheService;
            _signals = signals;
            _shellSettings = shellSettings;

            Logger = NullLogger.Instance;
        }
Example #5
0
		DnSpyLoaderManager(IImageManager imageManager, IThemeManager themeManager, ISettingsManager settingsManager, [ImportMany] IEnumerable<Lazy<IDnSpyLoader, IDnSpyLoaderMetadata>> mefLoaders) {
			this.imageManager = imageManager;
			this.themeManager = themeManager;
			this.settingsManager = settingsManager;
			this.loaders = mefLoaders.OrderBy(a => a.Metadata.Order).ToArray();
			this.windowLoader = new WindowLoader(this, imageManager, themeManager, settingsManager, loaders);
		}
Example #6
0
        public ApplicationManager(IMessengerManager messenger, ITranslationManager translation, IConfigurationManager configuration, IUserManager user, 
                                  INotifyIconManager notifyIcon, IEventLogManager logger, IControllerConfigurationManager controller, IThemeManager theme)
        {
            Messenger = messenger;
            Translation = translation;
            Configuration = configuration;
            User = user;
            NotifyIcon = notifyIcon;
            Logger = logger;
            Controller = controller;
            Theme = theme;

            Logger.Initialize(Constants.SERVICE_NAME);
            Logger.Subscribe(param => Messenger.NotifyColleagues(AppMessages.NEW_LOG_MESSAGE, param.Entry));

            string a = Configuration.GetData(ConfOptions.OPTION_ACCENT);
            string t = Configuration.GetData(ConfOptions.OPTION_THEME);
            Theme.SetTheme(a, t);

            Translation.ChangeLanguage(Configuration.GetData(ConfOptions.OPTION_LANGUAGE));

            DuplexChannelFactory<ISubscribingService> pipeFactory = new DuplexChannelFactory<ISubscribingService>(new ServiceCommand(Messenger),
                new NetNamedPipeBinding(), new EndpointAddress(Constants.PIPE_ADDRESS + Constants.SERVICE_NAME));
            Service = pipeFactory.CreateChannel();
            Service.Subscribe();
        }
Example #7
0
 BreakpointsVM(ILanguageManager languageManager, IImageManager imageManager, IThemeManager themeManager, IDebuggerSettings debuggerSettings, ITheDebugger theDebugger, IBreakpointManager breakpointManager, IBreakpointSettings breakpointSettings, Lazy<IModuleLoader> moduleLoader, IInMemoryModuleManager inMemoryModuleManager)
 {
     this.breakpointContext = new BreakpointContext(imageManager, moduleLoader) {
         Language = languageManager.Language,
         SyntaxHighlight = debuggerSettings.SyntaxHighlightBreakpoints,
         UseHexadecimal = debuggerSettings.UseHexadecimal,
         ShowTokens = breakpointSettings.ShowTokens,
         ShowModuleNames = breakpointSettings.ShowModuleNames,
         ShowParameterTypes = breakpointSettings.ShowParameterTypes,
         ShowParameterNames = breakpointSettings.ShowParameterNames,
         ShowOwnerTypes = breakpointSettings.ShowOwnerTypes,
         ShowReturnTypes = breakpointSettings.ShowReturnTypes,
         ShowNamespaces = breakpointSettings.ShowNamespaces,
         ShowTypeKeywords = breakpointSettings.ShowTypeKeywords,
     };
     this.breakpointManager = breakpointManager;
     this.theDebugger = theDebugger;
     this.breakpointList = new ObservableCollection<BreakpointVM>();
     breakpointSettings.PropertyChanged += BreakpointSettings_PropertyChanged;
     breakpointManager.OnListModified += BreakpointManager_OnListModified;
     debuggerSettings.PropertyChanged += DebuggerSettings_PropertyChanged;
     theDebugger.OnProcessStateChanged += TheDebugger_OnProcessStateChanged;
     themeManager.ThemeChanged += ThemeManager_ThemeChanged;
     languageManager.LanguageChanged += LanguageManager_LanguageChanged;
     inMemoryModuleManager.DynamicModulesLoaded += InMemoryModuleManager_DynamicModulesLoaded;
     foreach (var bp in breakpointManager.Breakpoints)
         AddBreakpoint(bp);
 }
Example #8
0
        public TreeViewImpl(ITreeViewManager treeViewManager, IThemeManager themeManager, IImageManager imageManager, Guid guid, TreeViewOptions options)
        {
            this.guid = guid;
            this.treeViewManager = treeViewManager;
            this.imageManager = imageManager;
            this.treeViewListener = options.TreeViewListener;
            this.sharpTreeView = new SharpTreeView();
            this.sharpTreeView.SelectionChanged += SharpTreeView_SelectionChanged;
            this.sharpTreeView.CanDragAndDrop = options.CanDragAndDrop;
            this.sharpTreeView.AllowDrop = options.AllowDrop;
            this.sharpTreeView.AllowDropOrder = options.AllowDrop;
            VirtualizingStackPanel.SetIsVirtualizing(this.sharpTreeView, options.IsVirtualizing);
            VirtualizingStackPanel.SetVirtualizationMode(this.sharpTreeView, options.VirtualizationMode);
            this.sharpTreeView.SelectionMode = options.SelectionMode;
            this.sharpTreeView.BorderThickness = new Thickness(0);
            this.sharpTreeView.ShowRoot = false;
            this.sharpTreeView.ShowLines = false;

            if (options.IsGridView) {
                this.sharpTreeView.ItemContainerStyle = (Style)Application.Current.FindResource(SharpGridView.ItemContainerStyleKey);
                this.sharpTreeView.Style = (Style)Application.Current.FindResource("SharpTreeViewGridViewStyle");
            }
            else {
                // Clear the value set by the constructor. This is required or our style won't be used.
                this.sharpTreeView.ClearValue(ItemsControl.ItemContainerStyleProperty);
                this.sharpTreeView.Style = (Style)Application.Current.FindResource(typeof(SharpTreeView));
            }

            this.sharpTreeView.GetPreviewInsideTextBackground = () => themeManager.Theme.GetColor(ColorType.SystemColorsHighlight).Background;
            this.sharpTreeView.GetPreviewInsideForeground = () => themeManager.Theme.GetColor(ColorType.SystemColorsHighlightText).Foreground;

            // Add the root at the end since Create() requires some stuff to have been initialized
            this.root = Create(options.RootNode ?? new TreeNodeDataImpl(new Guid(FileTVConstants.ROOT_NODE_GUID)));
            this.sharpTreeView.Root = this.root.Node;
        }
Example #9
0
 public IconBarMargin(ITextEditorUIContext uiContext, ITextLineObjectManager textLineObjectManager, IImageManager imageManager, IThemeManager themeManager)
 {
     this.uiContext = uiContext;
     this.textLineObjectManager = textLineObjectManager;
     this.imageManager = imageManager;
     this.themeManager = themeManager;
 }
Example #10
0
 TreeViewManager(IThemeManager themeManager, IImageManager imageManager, [ImportMany] IEnumerable<Lazy<ITreeNodeDataCreator, ITreeNodeDataCreatorMetadata>> treeNodeDataCreators)
 {
     this.themeManager = themeManager;
     this.imageManager = imageManager;
     this.guidToCreator = new Dictionary<Guid, List<Lazy<ITreeNodeDataCreator, ITreeNodeDataCreatorMetadata>>>();
     InitializeGuidToCreator(treeNodeDataCreators);
 }
Example #11
0
 public WindowManager(IEnvWindowsManager envWindowsManager, IHostedControls hostedControls, IResourceStore resourceStore, IThemeManager themeManager)
 {
     _envWindowsManager = envWindowsManager;
     _hostedControls = hostedControls;
     _resourceStore = resourceStore;
     _themeManager = themeManager;
 }
Example #12
0
 public TabManager(IThemeManager themeManager, IMenuManager menuManager, IWpfFocusManager wpfFocusManager)
 {
     themeManager.ThemeChanged += ThemeManager_ThemeChanged;
     this.menuManager = menuManager;
     this.wpfFocusManager = wpfFocusManager;
     this.tabGroupManagers = new List<TabGroupManager>();
     this.selectedIndex = -1;
 }
Example #13
0
		void OnThemeUpdated(IThemeManager themeManager) {
			var theme = themeManager.Theme;
			CodeBreakpointHighlightingColor = theme.GetTextColor(ColorType.BreakpointStatement).ToHighlightingColor();
			CodeBreakpointDisabledHighlightingColor = theme.GetTextColor(ColorType.DisabledBreakpointStatement).ToHighlightingColor();
			StackFrameCurrentHighlightingColor = theme.GetTextColor(ColorType.CurrentStatement).ToHighlightingColor();
			StackFrameReturnHighlightingColor = theme.GetTextColor(ColorType.ReturnStatement).ToHighlightingColor();
			StackFrameSelectedHighlightingColor = theme.GetTextColor(ColorType.SelectedReturnStatement).ToHighlightingColor();
		}
Example #14
0
		ExceptionsContent(IWpfCommandManager wpfCommandManager, IThemeManager themeManager, Lazy<IExceptionsVM> exceptionsVM) {
			this.exceptionsControl = new ExceptionsControl();
			this.vmExceptions = exceptionsVM;
			themeManager.ThemeChanged += ThemeManager_ThemeChanged;

			wpfCommandManager.Add(CommandConstants.GUID_DEBUGGER_EXCEPTIONS_CONTROL, exceptionsControl);
			wpfCommandManager.Add(CommandConstants.GUID_DEBUGGER_EXCEPTIONS_LISTVIEW, exceptionsControl.ListBox);
		}
 public InlineShapeFactory(IAuthorizer authorizer, 
     IWorkContextAccessor workContextAccessor,
     IShapeTableManager shapeTableManager,
     IThemeManager themeManager) {
     _authorizer = authorizer;
     _shapeTableManager = shapeTableManager;
     _themeManager = themeManager;
     _workContext = workContextAccessor.GetContext();
 }
Example #16
0
		LocalsContent(IWpfCommandManager wpfCommandManager, IThemeManager themeManager, ILocalsVM localsVM) {
			this.localsControl = new LocalsControl();
			this.vmLocals = localsVM;
			this.localsControl.DataContext = this.vmLocals;
			themeManager.ThemeChanged += ThemeManager_ThemeChanged;

			wpfCommandManager.Add(CommandConstants.GUID_DEBUGGER_LOCALS_CONTROL, localsControl);
			wpfCommandManager.Add(CommandConstants.GUID_DEBUGGER_LOCALS_LISTVIEW, localsControl.ListView);
		}
 public ViewComponentTagHelperDescriptorResolver(
     TagHelperTypeResolver typeResolver,
     IShapeTableManager shapeTableManager,
     IThemeManager themeManager)
     : base(typeResolver, designTime: false)
 {
     _shapteTableManager = shapeTableManager;
     _themeManager = themeManager;
 }
        public MPTButton()
        {
            themeManager = ServiceScope.Get<IThemeManager>();
              // Setup message queue for receiving Messages
              IMessageQueue queueMessage = ServiceScope.Get<IMessageBroker>().GetOrCreate("message");
              queueMessage.OnMessageReceive += OnMessageReceive;

              UseVisualStyleBackColor = true;
        }
Example #19
0
 public DefaultShapeFactory(
     IEnumerable<IShapeFactoryEvents> events,
     IShapeTableManager shapeTableManager,
     IThemeManager themeManager)
 {
     _events = events;
     _shapeTableManager = shapeTableManager;
     _themeManager = themeManager;
 }
 public SessionManager(INavigationService navService, IApiClient apiClient, ILogger logger, IThemeManager themeManager, ITheaterConfigurationManager config, IPlaybackManager playback)
 {
     _navService = navService;
     _apiClient = apiClient;
     _logger = logger;
     _themeManager = themeManager;
     _config = config;
     _playback = playback;
 }
 /// <summary>
 /// Creates a new HighlightingColorizer instance.
 /// Derived classes using this constructor must override the <see cref="CreateHighlighter"/> method.
 /// </summary>
 protected ThemedHighlightingColorizer()
 {
     _themeManager = AppContext.Resolve<IThemeManager>();
     _defaultStyle = new StylePart
     {
         Bold = false,
         Italic = false,
         Foreground = (_themeManager.CurrentTheme != null ? _themeManager.CurrentTheme.Foreground : "#000000")
     };
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="TheaterApplicationWindow" /> class.
        /// </summary>
        /// <param name="logger">The logger.</param>
        /// <param name="themeManager">The theme manager.</param>
        /// <param name="sessionFactory">The session factory.</param>
        /// <param name="configurationManager">The configuration manager.</param>
        public TheaterApplicationWindow(ILogger logger, IThemeManager themeManager, Func<ISessionManager> sessionFactory, ITheaterConfigurationManager configurationManager)
        {
            _logger = logger;
            _themeManager = themeManager;
            _sessionFactory = sessionFactory;
            _configurationManager = configurationManager;

            _themeManager.ThemeUnloaded += _themeManager_ThemeUnloaded;
            _themeManager.ThemeLoaded += _themeManager_ThemeLoaded;
        }
Example #23
0
 public BaseDisplayManager(
     IShapeTableManager shapeTableManager,
     IShapeFactory shapeFactory,
     IThemeManager themeManager
     )
 {
     _shapeTableManager = shapeTableManager;
     _shapeFactory = shapeFactory;
     _themeManager = themeManager;
 }
Example #24
0
		protected ScriptContent(IThemeManager themeManager, IReplEditorCreator replEditorCreator, ReplEditorOptions replOpts, IServiceLocator serviceLocator) {
			this.replEditorUI = replEditorCreator.Create(replOpts);
			this.scriptControl = new ScriptControl();
			this.scriptControl.SetTextEditorObject(this.replEditorUI.UIObject);
			this.scriptControlVM = CreateScriptControlVM(this.replEditorUI, serviceLocator);
			this.scriptControlVM.OnCommandExecuted += ScriptControlVM_OnCommandExecuted;
			this.replEditorUI.Tag = this;
			this.scriptControl.DataContext = this.scriptControlVM;
			themeManager.ThemeChanged += ThemeManager_ThemeChanged;
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="TheaterApplicationWindow" /> class.
        /// </summary>
        /// <param name="logger">The logger.</param>
        /// <param name="themeManager">The theme manager.</param>
        public TheaterApplicationWindow(ILogger logger, IThemeManager themeManager, IApiClient apiClient, Func<ISessionManager> sessionFactory)
        {
            _logger = logger;
            _themeManager = themeManager;
            _apiClient = apiClient;
            _sessionFactory = sessionFactory;

            _themeManager.ThemeUnloaded += _themeManager_ThemeUnloaded;
            _themeManager.ThemeLoaded += _themeManager_ThemeLoaded;
        }
 public ThemeSettingsViewModel(
     Func<HearthStatsDbContext> dbContext,
     IThemeManager themeManager)
 {
     this.dbContext = dbContext;
     this.themeManager = themeManager;
     this.DisplayName = "Theme settings:";
     this.InitializeTheme();
     this.PropertyChanged += ThemeSettingsViewModel_PropertyChanged;
     Order = 10;
 }
 public AppearancePage(ITheaterConfigurationManager config, ISessionManager session, IImageManager imageManager, IApiClient apiClient, IPresentationManager presentation, IThemeManager themeManager, INavigationService nav)
 {
     _config = config;
     _session = session;
     _imageManager = imageManager;
     _apiClient = apiClient;
     _presentation = presentation;
     _themeManager = themeManager;
     _nav = nav;
     InitializeComponent();
 }
Example #28
0
 public TagHelperMvcRazorHost(
     IChunkTreeCache chunkTreeCache,
     IShapeTableManager shapeTableManager,
     IThemeManager themeManager)
     : base(chunkTreeCache)
 {
     TagHelperDescriptorResolver = new ViewComponentTagHelperDescriptorResolver(
         new TagHelperTypeResolver(),
         shapeTableManager,
         themeManager);
 }
Example #29
0
        public SessionManager(INavigationService navService, ILogger logger, IThemeManager themeManager, ITheaterConfigurationManager config, IPlaybackManager playback, IConnectionManager connectionManager)
        {
            _navService = navService;
            _logger = logger;
            _themeManager = themeManager;
            _config = config;
            _playback = playback;
            _connectionManager = connectionManager;

            _connectionManager.RemoteLoggedOut += _connectionManager_RemoteLoggedOut;
        }
Example #30
0
 public MainWindow(IThemeManager themeManager, IImageManager imageManager, object content)
 {
     this.imageManager = imageManager;
     InitializeComponent();
     this.contentPresenter.Content = content;
     UpdateSystemMenuImage();
     themeManager.ThemeChanged += ThemeManager_ThemeChanged;
     this.Activated += (s, e) => UpdateSystemMenuImage();
     this.Deactivated += (s, e) => UpdateSystemMenuImage();
     this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => Close(), (s, e) => e.CanExecute = true));
 }
        public DefaultContentDefinitionDisplayManager(
            IEnumerable <IContentDefinitionDisplayHandler> handlers,
            IShapeTableManager shapeTableManager,
            IContentDefinitionManager contentDefinitionManager,
            IShapeFactory shapeFactory,
            IThemeManager themeManager,
            ILogger <DefaultContentDefinitionDisplayManager> logger,
            ILayoutAccessor layoutAccessor
            ) : base(shapeTableManager, shapeFactory, themeManager)
        {
            _handlers                 = handlers;
            _shapeTableManager        = shapeTableManager;
            _contentDefinitionManager = contentDefinitionManager;
            _shapeFactory             = shapeFactory;
            _themeManager             = themeManager;
            _layoutAccessor           = layoutAccessor;

            Logger = logger;
        }
Example #32
0
        SearchManager(IImageManager imageManager, ILanguageManager languageManager, IThemeManager themeManager, ISearchSettings searchSettings, IFileSearcherCreator fileSearcherCreator, IMenuManager menuManager, IWpfCommandManager wpfCommandManager, IFileTabManager fileTabManager)
        {
            this.fileTabManager = fileTabManager;
            this.searchControl  = new SearchControl();
            this.vmSearch       = new SearchControlVM(imageManager, fileSearcherCreator, fileTabManager.FileTreeView)
            {
                SyntaxHighlight      = searchSettings.SyntaxHighlight,
                Language             = languageManager.SelectedLanguage,
                BackgroundType       = BackgroundType.Search,
                SearchDecompiledData = true,
            };
            this.searchControl.DataContext = this.vmSearch;

            menuManager.InitializeContextMenu(this.searchControl.ListBox, MenuConstants.GUIDOBJ_SEARCH_GUID, new GuidObjectsCreator());
            wpfCommandManager.Add(CommandConstants.GUID_SEARCH_CONTROL, this.searchControl);
            wpfCommandManager.Add(CommandConstants.GUID_SEARCH_LISTBOX, this.searchControl.ListBox);
            languageManager.LanguageChanged += LanguageManager_LanguageChanged;
            themeManager.ThemeChanged       += ThemeManager_ThemeChanged;
            searchSettings.PropertyChanged  += SearchSettings_PropertyChanged;
            fileTabManager.FileTreeView.FileManager.CollectionChanged += FileManager_CollectionChanged;

            this.searchControl.SearchListBoxDoubleClick += (s, e) => FollowSelectedReference();
            var cmds    = wpfCommandManager.GetCommands(CommandConstants.GUID_SEARCH_LISTBOX);
            var command = new RelayCommand(a => FollowSelectedReference());

            cmds.Add(command, ModifierKeys.None, Key.Enter);
            cmds.Add(command, ModifierKeys.Control, Key.Enter);
            cmds.Add(command, ModifierKeys.Shift, Key.Enter);

            Add(SearchType.TypeDef, Key.T);
            Add(SearchType.FieldDef, Key.F);
            Add(SearchType.MethodDef, Key.M);
            Add(SearchType.PropertyDef, Key.P);
            Add(SearchType.EventDef, Key.E);
            Add(SearchType.ParamDef, Key.J);
            Add(SearchType.Local, Key.I);
            Add(SearchType.ParamLocal, Key.N);
            Add(SearchType.Resource, Key.R);
            Add(SearchType.Member, Key.U);
            Add(SearchType.Any, Key.B);
            Add(SearchType.Literal, Key.L);
        }
Example #33
0
        public FoodsPage(IThemeManager themeManager)
        {
            InitializeComponent();

            var theme = themeManager.GetThemeFromColor("bluePink");

            ActionBarBackgroundColor = theme.Primary;
            StatusBarColor           = theme.Dark;
            NavigationBarColor       = theme.Dark;
            ActionBarTextColor       = Color.White;
            Title = "Foods";

            _itemSelectedSubscriber = Observable.FromEventPattern <SelectedItemChangedEventArgs>(FoodsList, "ItemSelected")
                                      .Select(x => x.Sender)
                                      .Cast <ListView>()
                                      .Subscribe(l =>
            {
                l.SelectedItem = null;
            });
        }
Example #34
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 #35
0
        public ThemeConfigViewModel(IThemeSettingsProvider settings, IThemeManager themeManager, IMainWindowHolder mainWindowHolder)
        {
            var currentSettings = settings.GetSettings();

            name                         = CurrentThemeName = themeManager.CurrentTheme;
            themes                       = themeManager.Themes.ToList();
            useCustomScaling             = currentSettings.UseCustomScaling;
            scalingValue                 = Math.Clamp(currentSettings.CustomScaling, 0.5, 4);
            RecommendedScalingPercentage =
                (int)(((mainWindowHolder.Window?.Screens?.Primary ?? mainWindowHolder.Window?.Screens?.All?.FirstOrDefault())?.PixelDensity ?? 1) * 100);
            AllowCustomScaling = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);

            Save = new DelegateCommand(() =>
            {
                themeManager.SetTheme(ThemeName);
                themeManager.UpdateCustomScaling(useCustomScaling ? ScalingValue : null);
                settings.UpdateSettings(ThemeName, UseCustomScaling ? Math.Clamp(ScalingValue, 0.5, 4) : null);
                IsModified = false;
            });
        }
Example #36
0
        public DefaultHtmlDisplay(
            IEnumerable <IShapeDisplayEvents> shapeDisplayEvents,
            IEnumerable <IShapeBindingResolver> shapeBindingResolvers,
            IHttpContextAccessor httpContextAccessor,
            IShapeTableManager shapeTableManager,
            IServiceProvider serviceProvider,
            ILogger <DefaultHtmlDisplay> logger,
            IThemeManager themeManager)
        {
            _shapeTableManager     = shapeTableManager;
            _shapeDisplayEvents    = shapeDisplayEvents;
            _httpContextAccessor   = httpContextAccessor;
            _shapeBindingResolvers = shapeBindingResolvers;
            _themeManager          = themeManager;
            _serviceProvider       = serviceProvider;

            _logger = logger;

            T = NullLocalizer.Instance;
        }
Example #37
0
        void UpdateColors(IThemeManager themeManager)
        {
            var theme = themeManager.Theme;

            var color = theme.GetColor(ColorType.HexText);

            Application.Current.Resources[GetBackgroundResourceKey(ColorType.HexText)] = GetBrush(color.Background);
            Application.Current.Resources[GetForegroundResourceKey(ColorType.HexText)] = GetBrush(color.Foreground);
            Application.Current.Resources[GetFontStyleResourceKey(ColorType.HexText)]  = color.FontStyle ?? FontStyles.Normal;
            Application.Current.Resources[GetFontWeightResourceKey(ColorType.HexText)] = color.FontWeight ?? FontWeights.Normal;

            UpdateForeground(theme, ColorType.HexOffset);
            UpdateForeground(theme, ColorType.HexByte0);
            UpdateForeground(theme, ColorType.HexByte1);
            UpdateForeground(theme, ColorType.HexByteError);
            UpdateForeground(theme, ColorType.HexAscii);
            UpdateBackground(theme, ColorType.HexCaret);
            UpdateBackground(theme, ColorType.HexInactiveCaret);
            UpdateBackground(theme, ColorType.HexSelection);
        }
Example #38
0
        public CombinedResourceManager(
            IEnumerable <Meta <IResourceManifestProvider> > resourceProviders,
            ISiteService siteService,
            ICombinatorService combinatorService,
            IShapeTableLocator shapeTableLocator,
            IThemeManager themeManager,
            IHttpContextAccessor httpContextAccessor,
            ICacheManager cacheManager,
            ICombinatorEventMonitor combinatorEventMonitor)
            : base(resourceProviders)
        {
            _siteService            = siteService;
            _combinatorService      = combinatorService;
            _shapeTableLocator      = shapeTableLocator;
            _themeManager           = themeManager;
            _httpContextAccessor    = httpContextAccessor;
            _cacheManager           = cacheManager;
            _combinatorEventMonitor = combinatorEventMonitor;

            Logger = NullLogger.Instance;
        }
Example #39
0
 public LayerFilter(
     ILayerService layerService,
     ILayoutAccessor layoutAccessor,
     IContentItemDisplayManager contentItemDisplayManager,
     IUpdateModelAccessor modelUpdaterAccessor,
     IScriptingManager scriptingManager,
     IMemoryCache memoryCache,
     IThemeManager themeManager,
     IAdminThemeService adminThemeService,
     IVolatileDocumentManager <LayerState> layerStateManager)
 {
     _layerService              = layerService;
     _layoutAccessor            = layoutAccessor;
     _contentItemDisplayManager = contentItemDisplayManager;
     _modelUpdaterAccessor      = modelUpdaterAccessor;
     _scriptingManager          = scriptingManager;
     _memoryCache       = memoryCache;
     _themeManager      = themeManager;
     _adminThemeService = adminThemeService;
     _layerStateManager = layerStateManager;
 }
        public Flyout(IThemeManager themeManager, IFlyoutMetadata metadata, IScreen model)
            : this(themeManager, model)
        {
            if (themeManager == null)
            {
                throw new ArgumentNullException("themeManager");
            }
            if (metadata == null)
            {
                throw new ArgumentNullException("metadata");
            }
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            this.header   = metadata.Header;
            this.position = metadata.DefaultPosition;
            this.name     = metadata.Key;
            this.isModal  = metadata.IsModal;
        }
        public PageManagementAdminService(ILogger <PageManagementAdminService> logger,
                                          ILanguageManager languageManager,
                                          IPageRepository pageRepository,
                                          IModuleRepository moduleRepository,
                                          INavigation navigation,
                                          IScopeService scopeService,
                                          IThemeManager themeManager)
        {
            _logger           = logger;
            _languageManager  = languageManager;
            _pageRepository   = pageRepository;
            _mapper           = PageManagementMapper.Mapper;
            _moduleRepository = moduleRepository;
            _navigation       = navigation;
            //_scopeService = scopeService;
            _themeManager = themeManager;

            //_pageTypes = GetPageTypes();
            _modules = GetModules();
            _themes  = GetThemes();
        }
Example #42
0
 public LayerFilter(
     ILayerService layerService,
     ILayoutAccessor layoutAccessor,
     IContentItemDisplayManager contentItemDisplayManager,
     IUpdateModelAccessor modelUpdaterAccessor,
     IScriptingManager scriptingManager,
     IMemoryCache memoryCache,
     ISignal signal,
     IThemeManager themeManager,
     IAdminThemeService adminThemeService)
 {
     _layerService              = layerService;
     _layoutAccessor            = layoutAccessor;
     _contentItemDisplayManager = contentItemDisplayManager;
     _modelUpdaterAccessor      = modelUpdaterAccessor;
     _scriptingManager          = scriptingManager;
     _memoryCache       = memoryCache;
     _signal            = signal;
     _themeManager      = themeManager;
     _adminThemeService = adminThemeService;
 }
Example #43
0
        public MdameerContentDisplay(
            Lazy <IEnumerable <IContentHandler> > handlers,
            IShapeFactory shapeFactory,
            Lazy <IShapeTableLocator> shapeTableLocator,
            RequestContext requestContext,
            IVirtualPathProvider virtualPathProvider,
            IWorkContextAccessor workContextAccessor,
            IOrchardServices orchardServices,
            IShapeDisplay shapeDisplay,
            IThemeManager themeManager,
            ShellSettings shellSettings,
            ICacheManager cacheManager,
            IOutputCacheStorageProvider cacheStorageProvider,
            ITagCache tagCache,
            IClock clock,
            ISignals signals,
            IResourceManager resourceManager,
            IJsonConverter jsonConverter) :
            base(handlers, shapeFactory, shapeTableLocator, requestContext, virtualPathProvider, workContextAccessor)
        {
            _handlers             = handlers;
            _shapeFactory         = shapeFactory;
            _shapeTableLocator    = shapeTableLocator;
            _requestContext       = requestContext;
            _virtualPathProvider  = virtualPathProvider;
            _workContextAccessor  = workContextAccessor;
            _orchardServices      = orchardServices;
            _shapeDisplay         = shapeDisplay;
            _themeManager         = themeManager;
            _shellSettings        = shellSettings;
            _cacheManager         = cacheManager;
            _cacheStorageProvider = cacheStorageProvider;
            _tagCache             = tagCache;
            _clock           = clock;
            _signals         = signals;
            _resourceManager = resourceManager;
            _jsonConverter   = jsonConverter;

            Logger = NullLogger.Instance;
        }
Example #44
0
        OutputContent(IWpfCommandManager wpfCommandManager, IThemeManager themeManager, Lazy <IOutputManagerInternal> outputVM)
        {
            this.outputControl         = new OutputControl();
            this.vmOutput              = outputVM;
            themeManager.ThemeChanged += ThemeManager_ThemeChanged;

            wpfCommandManager.Add(CommandConstants.GUID_OUTPUT_CONTROL, outputControl);
            var cmds = wpfCommandManager.GetCommands(CommandConstants.GUID_OUTPUT_CONTROL);

            cmds.Add(ApplicationCommands.Save,
                     (s, e) => OutputManager.SaveText(),
                     (s, e) => e.CanExecute = OutputManager.CanSaveText);
            cmds.Add(OutputCommands.CopyCommand,
                     (s, e) => OutputManager.Copy(),
                     (s, e) => e.CanExecute = OutputManager.CanCopy);
            cmds.Add(OutputCommands.CopyCommand, ModifierKeys.Control, Key.C);
            cmds.Add(OutputCommands.ClearAllCommand,
                     (s, e) => OutputManager.ClearAll(),
                     (s, e) => e.CanExecute = OutputManager.CanClearAll);
            cmds.Add(OutputCommands.ClearAllCommand, ModifierKeys.Control, Key.L);
            cmds.Add(OutputCommands.ToggleWordWrapCommand,
                     (s, e) => OutputManager.WordWrap = !OutputManager.WordWrap,
                     (s, e) => e.CanExecute           = true);
            cmds.Add(OutputCommands.ToggleShowLineNumbersCommand,
                     (s, e) => OutputManager.ShowLineNumbers = !OutputManager.ShowLineNumbers,
                     (s, e) => e.CanExecute = true);
            cmds.Add(OutputCommands.ToggleShowTimestampsCommand,
                     (s, e) => OutputManager.ShowTimestamps = !OutputManager.ShowTimestamps,
                     (s, e) => e.CanExecute = true);
            for (int i = 0; i < OutputCommands.SelectLogWindowCommands.Length; i++)
            {
                int tmpIndex = i;
                cmds.Add(OutputCommands.SelectLogWindowCommands[i],
                         (s, e) => SelectLog(tmpIndex),
                         (s, e) => e.CanExecute = OutputManager.CanSelectLog(tmpIndex));
            }

            outputControl.PreviewKeyDown += OutputControl_PreviewKeyDown;
        }
Example #45
0
        public void LoadDefaultTheme()
        {
            IThemeSettings settings = _container.Resolve <IThemeSettings>();
            IThemeManager  manager  = _container.Resolve <IThemeManager>();

            if (settings.SelectedTheme == "Default")
            {
                String newTheme = settings.GetSystemTheme();
                if (newTheme == "Default")
                {
                    manager.SetCurrent("Blue");
                }
                else
                {
                    manager.SetCurrent(newTheme);
                }
            }
            else
            {
                manager.SetCurrent(settings.SelectedTheme);
            }
        }
        private readonly ITagForCache _tagForCache;               //Added


        public OutputCacheExtensionFilter(
            ICacheAliasServices cacheAliasServices, //Added
            ITokenizer tokenizer,                   //Added
            ITagForCache tagForCache,               //Added
            ICacheManager cacheManager, IOutputCacheStorageProvider cacheStorageProvider, ITagCache tagCache, IDisplayedContentItemHandler displayedContentItemHandler, IWorkContextAccessor workContextAccessor, IThemeManager themeManager, IClock clock, ICacheService cacheService, ISignals signals, ShellSettings shellSettings, ICachingEventHandler cachingEvents) : base(cacheManager, cacheStorageProvider, tagCache, displayedContentItemHandler, workContextAccessor, themeManager, clock, cacheService, signals, shellSettings, cachingEvents)
        {
            _cacheAliasServices          = cacheAliasServices; //Added
            _tokenizer                   = tokenizer;          //Added
            _tagForCache                 = tagForCache;        //Added
            _cacheManager                = cacheManager;
            _cacheStorageProvider        = cacheStorageProvider;
            _tagCache                    = tagCache;
            _displayedContentItemHandler = displayedContentItemHandler;
            _workContextAccessor         = workContextAccessor;
            _themeManager                = themeManager;
            _clock         = clock;
            _cacheService  = cacheService;
            _signals       = signals;
            _shellSettings = shellSettings;
            _cachingEvents = cachingEvents;

            Logger = NullLogger.Instance;
        }
Example #47
0
        protected override void ApplyTheme(ITheme theme)
        {
            base.ApplyTheme(theme);
            if (TryGetResourceDictionaries(theme, out ResourceDictionary light, out ResourceDictionary dark))
            {
                switch (BaseTheme)
                {
                case Wpf.BaseTheme.Light:
                    MergedDictionaries.Add(light);
                    break;

                case Wpf.BaseTheme.Dark:
                    MergedDictionaries.Add(dark);
                    break;
                }

                IThemeManager themeManager = this.GetThemeManager();
                if (themeManager != null)
                {
                    themeManager.ThemeChanged += ThemeManagerOnThemeChanged;
                }
            }
        }
Example #48
0
        public MemoryContent(IWpfCommandManager wpfCommandManager, IThemeManager themeManager, IMenuManager menuManager, IHexEditorSettings hexEditorSettings, IMemoryVM memoryVM, IAppSettings appSettings)
        {
            this.memoryControl = new MemoryControl();
            this.vmMemory      = memoryVM;
            this.vmMemory.SetRefreshLines(() => this.memoryControl.DnHexBox.RedrawModifiedLines());
            this.memoryControl.DataContext = this.vmMemory;
            var dnHexBox = new DnHexBox(menuManager, hexEditorSettings)
            {
                CacheLineBytes = true,
                IsMemory       = true,
            };

            dnHexBox.SetBinding(HexBox.DocumentProperty, nameof(vmMemory.HexDocument));
            this.memoryControl.DnHexBox = dnHexBox;
            dnHexBox.StartOffset        = 0;
            dnHexBox.EndOffset          = IntPtr.Size == 4 ? uint.MaxValue : ulong.MaxValue;

            appSettings.PropertyChanged += AppSettings_PropertyChanged;
            UpdateHexBoxRenderer(appSettings.UseNewRenderer_HexEditor);

            wpfCommandManager.Add(CommandConstants.GUID_DEBUGGER_MEMORY_CONTROL, memoryControl);
            wpfCommandManager.Add(CommandConstants.GUID_DEBUGGER_MEMORY_HEXBOX, memoryControl.DnHexBox);
        }
Example #49
0
        public TreeViewImpl(ITreeViewManager treeViewManager, IThemeManager themeManager, IImageManager imageManager, Guid guid, TreeViewOptions options)
        {
            this.Guid             = guid;
            this.treeViewManager  = treeViewManager;
            this.imageManager     = imageManager;
            this.treeViewListener = options.TreeViewListener;
            this.sharpTreeView    = new SharpTreeView();
            this.sharpTreeView.SelectionChanged += SharpTreeView_SelectionChanged;
            this.sharpTreeView.CanDragAndDrop    = options.CanDragAndDrop;
            this.sharpTreeView.AllowDrop         = options.AllowDrop;
            this.sharpTreeView.AllowDropOrder    = options.AllowDrop;
            VirtualizingStackPanel.SetIsVirtualizing(this.sharpTreeView, options.IsVirtualizing);
            VirtualizingStackPanel.SetVirtualizationMode(this.sharpTreeView, options.VirtualizationMode);
            this.sharpTreeView.SelectionMode   = options.SelectionMode;
            this.sharpTreeView.BorderThickness = new Thickness(0);
            this.sharpTreeView.ShowRoot        = false;
            this.sharpTreeView.ShowLines       = false;

            if (options.IsGridView)
            {
                this.sharpTreeView.ItemContainerStyle = (Style)Application.Current.FindResource(SharpGridView.ItemContainerStyleKey);
                this.sharpTreeView.Style = (Style)Application.Current.FindResource("SharpTreeViewGridViewStyle");
            }
            else
            {
                // Clear the value set by the constructor. This is required or our style won't be used.
                this.sharpTreeView.ClearValue(ItemsControl.ItemContainerStyleProperty);
                this.sharpTreeView.Style = (Style)Application.Current.FindResource(typeof(SharpTreeView));
            }

            this.sharpTreeView.GetPreviewInsideTextBackground = () => themeManager.Theme.GetColor(ColorType.SystemColorsHighlight).Background;
            this.sharpTreeView.GetPreviewInsideForeground     = () => themeManager.Theme.GetColor(ColorType.SystemColorsHighlightText).Foreground;

            // Add the root at the end since Create() requires some stuff to have been initialized
            this.root = Create(options.RootNode ?? new TreeNodeDataImpl(new Guid(FileTVConstants.ROOT_NODE_GUID)));
            this.sharpTreeView.Root = this.root.Node;
        }
Example #50
0
        public ThemeManagerSettingWindow(IThemeManager themeManager, ThemeManagerSettings settings, ISettingManager manager, ISettings globalSettings)
        {
            var themes = themeManager;

            _settings       = settings;
            _manager        = manager;
            _globalSettings = globalSettings;

            _globalSettings.PropertyChanged += GlobalSettings_PropertyChanged;

            _settings.DeferChanges();

            InitializeComponent();

            foreach (var themeMeta in themes.Themes)
            {
                var selectedTheme = settings.SelectedTheme == themeMeta.Title;
                var cb            = new ComboBoxItem
                {
                    IsSelected = selectedTheme,
                    Content    = themeMeta.Title
                };

                ThemeList.Items.Add(cb);
            }

            if (themes.ActiveTheme.SettingEditWindow != null)
            {
                SettingPage.Children.Clear();
                SettingPage.Children.Add((UserControl)themes.ResolveSettingWindow(themes.ActiveTheme));
            }

            ThemeList.SelectionChanged += ThemeList_SelectionChanged;

            Unloaded += ThemeManagerSettingWindow_Unloaded;
        }
Example #51
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="ThemeableRazorViewEngine" /> class.
        /// </summary>
        public ThemeableRazorViewEngine(string themeFolderVirutalPath, IThemeManager themeManager, params string[] fileExtensions)
        {
            if (string.IsNullOrWhiteSpace(themeFolderVirutalPath))
            {
                throw new ArgumentNullException("themeFolderVirutalPath");
            }
            if (!themeFolderVirutalPath.StartsWith("~") || themeFolderVirutalPath.EndsWith("/"))
            {
                throw new ArgumentException("themeFolderVirutalPath must start with '~' and not end with '/'");
            }
            _themeFolderVirutalPath = themeFolderVirutalPath;

            if (themeManager == null)
            {
                throw new ArgumentNullException("themeManager");
            }
            _themeManager = themeManager;

            if (fileExtensions == null || fileExtensions.Length == 0)
            {
                throw new ArgumentException("themeFolderVirutalPath must start with '~' and not end with '/'");
            }
            FileExtensions = fileExtensions;

            string[] areaLocationFormats = CreateLocationFormats(LocationType.Area);
            AreaViewLocationFormats        = areaLocationFormats;
            AreaMasterLocationFormats      = areaLocationFormats;
            AreaPartialViewLocationFormats = areaLocationFormats;

            string[] defaultLocationFormats = CreateLocationFormats(LocationType.Default);
            ViewLocationFormats        = defaultLocationFormats;
            MasterLocationFormats      = defaultLocationFormats;
            PartialViewLocationFormats = defaultLocationFormats;

            Current = this;
        }
Example #52
0
 HexBoxThemeHelper(IThemeManager themeManager)
 {
     themeManager.ThemeChanged += ThemeManager_ThemeChanged;
     UpdateColors(themeManager);
 }
Example #53
0
 public Theme(IThemeManager themeManager, IPresentationManager presentationManager)
 {
     _themeManager        = themeManager;
     _presentationManager = presentationManager;
 }
Example #54
0
 public DummyLoginHandler(IThemeManager themeManager)
 {
     this.themeManager = themeManager;
 }
Example #55
0
 public LessonPlanCreateManager(ApplicationDbContext Data, IThemeManager themeManager, IDocumentConnector documentConnector)
 {
     this.Data              = Data;
     this.themeManager      = themeManager;
     this.documentConnector = documentConnector;
 }
Example #56
0
        public TextEditorControl(IThemeManager themeManager, ToolTipHelper toolTipHelper, ITextEditorSettings textEditorSettings, ITextEditorUIContextImpl uiContext, ITextEditorHelper textEditorHelper, ITextLineObjectManager textLineObjectManager, IImageManager imageManager, IIconBarCommandManager iconBarCommandManager)
        {
            this.references         = new TextSegmentCollection <ReferenceSegment>();
            this.themeManager       = themeManager;
            this.toolTipHelper      = toolTipHelper;
            this.textEditorSettings = textEditorSettings;
            this.textEditorHelper   = textEditorHelper;
            InitializeComponent();
            this.textEditorSettings.PropertyChanged += TextEditorSettings_PropertyChanged;

            themeManager.ThemeChanged += ThemeManager_ThemeChanged;

            textEditor = new NewTextEditor(themeManager);
            this.toolTipHelper.Initialize(TextEditor);
            RemoveCommands(TextEditor);
            newTextEditor.Content      = TextEditor;
            TextEditor.IsReadOnly      = true;
            TextEditor.ShowLineNumbers = true;
            TextEditor.Options.RequireControlModifierForHyperlinkClick = false;

            referenceElementGenerator = new ReferenceElementGenerator(JumpToReference, a => true);
            // Add the ref elem generator first in case one of the refs looks like a http link etc
            TextEditor.TextArea.TextView.ElementGenerators.Insert(0, referenceElementGenerator);
            this.uiElementGenerator = new UIElementGenerator();
            textEditor.TextArea.TextView.ElementGenerators.Add(uiElementGenerator);

            TextEditor.SetBinding(FontFamilyProperty, new Binding {
                Source = textEditorSettings,
                Path   = new PropertyPath("FontFamily"),
                Mode   = BindingMode.OneWay,
            });
            TextEditor.SetBinding(FontSizeProperty, new Binding {
                Source = textEditorSettings,
                Path   = new PropertyPath("FontSize"),
                Mode   = BindingMode.OneWay,
            });
            TextEditor.SetBinding(ICSharpCode.AvalonEdit.TextEditor.WordWrapProperty, new Binding {
                Source = textEditorSettings,
                Path   = new PropertyPath("WordWrap"),
                Mode   = BindingMode.OneWay,
            });

            iconBarMargin = new IconBarMargin(uiContext, textLineObjectManager, imageManager, themeManager);
            iconBarCommandManager.Initialize(iconBarMargin);
            TextEditor.TextArea.LeftMargins.Insert(0, iconBarMargin);
            TextEditor.TextArea.TextView.VisualLinesChanged += (s, e) => iconBarMargin.InvalidateVisual();

            textMarkerService = new TextMarkerService(this, uiContext, textLineObjectManager);
            TextEditor.TextArea.TextView.BackgroundRenderers.Add(textMarkerService);
            TextEditor.TextArea.TextView.LineTransformers.Add(textMarkerService);

            searchPanel = SearchPanel.Install(TextEditor.TextArea);
            searchPanel.RegisterCommands(this.CommandBindings);
            searchPanel.Localization = new AvalonEditSearchPanelLocalization();

            TextEditor.TextArea.Caret.PositionChanged += Caret_PositionChanged;

            TextEditor.TextArea.MouseRightButtonDown += (s, e) => TextEditor.GoToMousePosition();

            InputBindings.Add(new KeyBinding(new RelayCommand(a => MoveReference(true)), Key.Tab, ModifierKeys.None));
            InputBindings.Add(new KeyBinding(new RelayCommand(a => MoveReference(false)), Key.Tab, ModifierKeys.Shift));
            InputBindings.Add(new KeyBinding(new RelayCommand(a => MoveToNextDefinition(true)), Key.Down, ModifierKeys.Alt));
            InputBindings.Add(new KeyBinding(new RelayCommand(a => MoveToNextDefinition(false)), Key.Up, ModifierKeys.Alt));
            InputBindings.Add(new KeyBinding(new RelayCommand(a => FollowReference()), Key.F12, ModifierKeys.None));
            InputBindings.Add(new KeyBinding(new RelayCommand(a => FollowReference()), Key.Enter, ModifierKeys.None));
            InputBindings.Add(new KeyBinding(new RelayCommand(a => FollowReferenceNewTab()), Key.F12, ModifierKeys.Control));
            InputBindings.Add(new KeyBinding(new RelayCommand(a => FollowReferenceNewTab()), Key.Enter, ModifierKeys.Control));
            InputBindings.Add(new KeyBinding(new RelayCommand(a => ClearMarkedReferencesAndToolTip()), Key.Escape, ModifierKeys.None));

            this.AddHandler(GotKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnGotKeyboardFocus), true);
            this.AddHandler(LostKeyboardFocusEvent, new KeyboardFocusChangedEventHandler(OnLostKeyboardFocus), true);

            OnHighlightCurrentLineChanged();
            OnShowLineNumbersChanged();
            OnAutoHighlightRefsChanged();
        }
 public ThemeChangerConfiguration(IThemeSettingsProvider settings, IThemeManager themeManager)
 {
     themeSettings     = settings;
     this.themeManager = themeManager;
 }
Example #58
0
        public AppearancePage(ITheaterConfigurationManager config, ISessionManager session, IImageManager imageManager, IApiClient apiClient, IPresentationManager presentation, IThemeManager themeManager, INavigationService nav, IScreensaverManager screensaverManager)
        {
            _config             = config;
            _session            = session;
            _imageManager       = imageManager;
            _apiClient          = apiClient;
            _presentation       = presentation;
            _themeManager       = themeManager;
            _nav                = nav;
            _screensaverManager = screensaverManager;

            InitializeComponent();
        }
Example #59
0
 public ArtPieceManager(ApplicationDbContext Data, IThemeManager themeManager)
 {
     this.Data         = Data;
     this.themeManager = themeManager;
 }
Example #60
0
        public ShellViewModel(IWindowManager windowManager
                              , IEventAggregator eventAggregator
                              , RibbonViewModel ribbonViewModel
                              , StatusBarViewModel statusBar
                              , IConductor conductor
                              , IDaxStudioHost host
                              , IVersionCheck versionCheck
                              , IGlobalOptions options
                              , IAutoSaver autoSaver
                              , IThemeManager themeManager
                              )
        {
            utcSessionStart  = DateTime.UtcNow;
            Ribbon           = ribbonViewModel;
            Ribbon.Shell     = this;
            StatusBar        = statusBar;
            Options          = options;
            AutoSaver        = autoSaver;
            ThemeManager     = themeManager;
            _windowManager   = windowManager;
            _eventAggregator = eventAggregator;
            _eventAggregator.Subscribe(this);
            Tabs = (DocumentTabViewModel)conductor;
            Tabs.ConductWith(this);
            //Tabs.CloseStrategy = new ApplicationCloseStrategy();
            Tabs.CloseStrategy = IoC.Get <ApplicationCloseAllStrategy>();
            _host     = host;
            _app      = Application.Current;
            _username = UserHelper.GetUser();
            var recoveringFiles = false;

            // get master auto save indexes and only get crashed index files...
            var autoSaveInfo   = AutoSaver.LoadAutoSaveMasterIndex();
            var filesToRecover = autoSaveInfo.Values.Where(idx => idx.IsCurrentVersion && idx.ShouldRecover).SelectMany(entry => entry.Files);

            // check for auto-saved files and offer to recover them
            if (filesToRecover.Any())
            {
                recoveringFiles = true;
                RecoverAutoSavedFiles(autoSaveInfo);
            }
            else
            {
                // if there are no auto-save files to recover, start the auto save timer
                eventAggregator.PublishOnUIThreadAsync(new StartAutoSaveTimerEvent());
            }

            // if a filename was passed in on the command line open it
            if (!string.IsNullOrEmpty(_host.CommandLineFileName))
            {
                Tabs.NewQueryDocument(_host.CommandLineFileName);
            }

            // if no tabs are open at this point and we are not recovering autosave file then, open a blank document
            if (Tabs.Items.Count == 0 && !recoveringFiles)
            {
                NewDocument();
            }


            VersionChecker = versionCheck;

            DisplayName = AppTitle;

            Application.Current.Activated += OnApplicationActivated;
            Log.Verbose("============ Shell Started - v{version} =============", Version.ToString());

            AutoSaveTimer          = new Timer(Constants.AutoSaveIntervalMs);
            AutoSaveTimer.Elapsed += new ElapsedEventHandler(AutoSaveTimerElapsed);
        }