Esempio n. 1
0
        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();
        }
Esempio n. 2
0
 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));
 }