Example #1
0
        /// <summary>
        /// Loads the settings.
        /// </summary>
        /// <returns></returns>
        public AppConfiguration LoadAdministrativeConfiguration()
        {
            string settingFilePath = GetAdministrativeConfigurationFilePath();

            if (File.Exists(settingFilePath) == false)
            {
                return new AppConfiguration()
                       {
                           Exist = false
                       }
            }
            ;

            AppConfiguration configuration = SerializationManager.ReadSettings <AppConfiguration>(settingFilePath);

            configuration.Exist = true;
            DocumentTemplateManager.GetInstance().UpdateTemplateImages(configuration.DocumentTemplates);

            foreach (ExplorerLocation explorerLocation in configuration.ExplorerConfiguration.ExplorerLocations)
            {
                if (explorerLocation.Folder == null && explorerLocation.BasicFolderDefinition != null)
                {
                    SiteSetting     siteSetting    = configuration.SiteSettings[explorerLocation.BasicFolderDefinition.SiteSettingID];
                    IServiceManager serviceManager = ServiceManagerFactory.GetServiceManager(siteSetting.SiteSettingType);
                    explorerLocation.Folder = serviceManager.GetFolderByBasicFolderDefinition(siteSetting, explorerLocation.BasicFolderDefinition, true);
                }
            }

            return(configuration);
        }
Example #2
0
        /// <summary>
        /// Saves the settings.
        /// </summary>
        public void SaveAppConfiguration()
        {
            string configurationFilePath = this.GetConfigurationFilePath();

            DocumentTemplateManager.GetInstance().CopyTemplateDocumentsIntoTemplatesFolder(this.Configuration);
            SerializationManager.SaveConfiguration <AppConfiguration>(this.Configuration, configurationFilePath);
        }
 public static DocumentTemplateManager GetInstance()
 {
     if (_instance == null)
     {
         _instance = new DocumentTemplateManager();
     }
     return(_instance);
 }
Example #4
0
        /// <summary>
        /// Loads the settings.
        /// </summary>
        /// <returns></returns>
        public AppConfiguration LoadConfiguration()
        {
            string settingFilePath = GetConfigurationFilePath();

            if (File.Exists(settingFilePath) == false)
            {
                return new AppConfiguration()
                       {
                           Exist = false
                       }
            }
            ;

            AppConfiguration configuration = SerializationManager.ReadSettings <AppConfiguration>(settingFilePath);

            configuration.Exist = true;
            DocumentTemplateManager.GetInstance().UpdateTemplateImages(configuration.DocumentTemplates);
            return(configuration);
        }