public CremaAppHostViewModel(ICremaHost cremaHost, IAppConfiguration configs, ICompositionService compositionService) { this.cremaHost = cremaHost; this.cremaHost.Opened += CremaHost_Opened; this.configs = configs; this.compositionService = compositionService; this.theme = Themes.Keys.FirstOrDefault(); this.themeColor = FirstFloor.ModernUI.Presentation.AppearanceManager.Current.AccentColor; this.loginCommand = new DelegateCommand((p) => this.Login(), (p) => this.CanLogin); this.connectionItems = ConnectionItemCollection.Read(AppUtility.GetDocumentFilename("ConnectionList.xml")); this.compositionService.SatisfyImportsOnce(this.connectionItems); this.ConnectionItem = this.connectionItems.FirstOrDefault(item => item.IsDefault); this.authenticator = this.cremaHost.GetService(typeof(Authenticator)) as Authenticator; this.configs.Update(this); this.PropertyChanged += (s, e) => { if (e.PropertyName == nameof(this.IsProgressing)) { this.Shell.IsProgressing = this.IsProgressing; } else if (e.PropertyName == nameof(this.ProgressMessage)) { this.Shell.ProgressMessage = this.ProgressMessage; } }; }
public CremaAppHostViewModel(ICremaHost cremaHost, IAppConfiguration configs, IBuildUp buildUp, CremaSettings settings, Lazy <DataBaseServiceViewModel> dataBaseService, Lazy <DataBaseListViewModel> dataBaseSelections, Lazy <IShell> shell) { this.cremaHost = cremaHost; this.cremaHost.Opened += CremaHost_Opened; this.configs = configs; this.buildUp = buildUp; this.settings = settings; this.dataBaseService = dataBaseService; this.dataBaseSelections = dataBaseSelections; this.shell = shell; this.theme = Themes.Keys.FirstOrDefault(); this.themeColor = FirstFloor.ModernUI.Presentation.AppearanceManager.Current.AccentColor; this.ConnectionItems = ConnectionItemCollection.Read(this, AppUtility.GetDocumentFilename("ConnectionList.xml")); this.buildUp.BuildUp(this.ConnectionItems); this.ConnectionItem = this.ConnectionItems.FirstOrDefault(item => item.IsDefault); this.authenticator = this.cremaHost.GetService(typeof(Authenticator)) as Authenticator; this.configs.Update(this); this.PropertyChanged += (s, e) => { if (e.PropertyName == nameof(this.IsProgressing)) { this.Shell.IsProgressing = this.IsProgressing; } else if (e.PropertyName == nameof(this.ProgressMessage)) { this.Shell.ProgressMessage = this.ProgressMessage; } }; }
public ConsoleConfiguration([ImportMany] IEnumerable <IConfigurationPropertyProvider> propertiesProvider) : base(propertiesProvider) { this.xmlPath = AppUtility.GetDocumentFilename("configs") + ".xml"; this.xsdPath = AppUtility.GetDocumentFilename("configs") + ".xsd"; this.SchemaLocation = UriUtility.MakeRelative(this.xmlPath, this.xsdPath); if (File.Exists(this.xmlPath) == true) { try { //this.Read(this.xmlPath); } catch (Exception e) { CremaLog.Error(e); } } }
public ConsoleConfiguration([ImportMany] IEnumerable <IConfigurationPropertyProvider> propertiesProvider) : base(AppUtility.GetDocumentFilename("configs.xml"), propertiesProvider) { }