internal void Build(SettingsModule settings, List <ContentItem> items) { List <DomainViewModel> list = new List <DomainViewModel>(); List <DomainPathMapViewModel> additions = new List <DomainPathMapViewModel>(); foreach (var domain in settings.Settings.Domains) { var item = Items.FirstOrDefault(p => p.Id.Equals(domain.Id, StringComparison.OrdinalIgnoreCase)); if (item == null) { item = new DomainPathMapViewModel(new DomainPathMap() { Id = domain.Id, Display = domain.Name, Slug = domain.Name.ToLower(), Path = domain.Name.ToLower(), Items = new List <PathNode>().Default() }); additions.Add(item); } list.Add(new DomainViewModel(domain, item)); } additions.ForEach(x => { Items.Add(x); }); Build(items); settings.Initialize(list); }
public WorkspaceViewModel(Workspace model) { // first time setting we don't want // 'setup lazy loaded modules to fire _DataServiceStrategy = model.DataServiceStrategy; DataServices.Add(new XmlDataService()); DataServices.Add(new JsonDataService()); var found = DataServices.FirstOrDefault(x => x.Key.Equals(model.DataServiceStrategy)); if (found != null) { _DataService = found; } Overlay.RegisterOverlay(AppConstants.OverlayContent, ShowContentOverlay); Settings = new SettingsModule(DataService); Settings.Setup(); Tasks = new TasksModule(DataService, Settings); Tasks.Setup(); Paths = new VirtualPathModule(DataService); Paths.Setup(); Mimes = new MimeModule(DataService); Mimes.Setup(); Indexer = new IndexerModule(DataService, Settings); Indexer.Setup(); Schema = new SchemaModule(DataService, Settings); Schema.Setup(); Content = new ContentModule(DataService, Settings, Indexer, Paths, Schema); Content.Setup(Mimes); Credentials = new CredentialsModule(DataService) { }; Credentials.Setup(); Rolodex = new RolodexModule(DataService); Rolodex.Setup(); Datatool = new DatatoolModule(DataService); Datatool.Setup(); Workflow = new WorkflowModule(); }
public ContentModule(IDataService dataService, SettingsModule settings, IndexerModule indexer, VirtualPathModule paths, SchemaModule schema) { DataService = dataService; Settings = settings; settings.DomainSelected = HandleDomainSelected; settings.DomainAdded = HandleDomainAdded; settings.TagHelpersChanged = HandleTagHelpersChanged; HandleTagHelpersChanged(Settings.TagHelpers); settings.EnableContentSchema = HandleEnableContentSchemas; Input.IsEnableContentSchemas = settings.IsEnableContentSchemas; UserPreferences = Settings.UserPreferences; Indexer = indexer.Indexer; Languages = indexer.Languages; indexer.LanguageAdded = HandleLanguageAdded; Paths = paths; JsonSchemas = schema.JsonSchemas; ContentManager = new ContentManager(Path.Combine(AppConstants.ContentDirectory, AppConstants.ContentFiles)); }
public SchemaModule(IDataService dataService, SettingsModule settings) { DataService = dataService; Settings = settings; }