/// <summary> /// Get server configuration section of the web.config. /// </summary> public ServerConfiguration() { YamlParser parser = new YamlParser(); dynamic configuration = parser.GetConfiguration("server"); ConfigurationValuesGetter valuesGetter = new ConfigurationValuesGetter(configuration); int defaultPort = Convert.ToInt32(this.serverConfiguration["httpPort"]); this.HttpPort = valuesGetter.GetIntegerPropertyValue("connector", defaultPort, "port"); this.HostAddress = valuesGetter.GetStringPropertyValue("hostAddress", this.HostAddress); }
/// <summary> /// Constructor /// </summary> public CommonConfiguration() { YamlParser parser = new YamlParser(); dynamic configuration = parser.GetConfiguration("common"); ConfigurationValuesGetter valuesGetter = new ConfigurationValuesGetter(configuration); download = valuesGetter.GetBooleanPropertyValue("download", Convert.ToBoolean(commonConfiguration["isDownload"])); upload = valuesGetter.GetBooleanPropertyValue("upload", Convert.ToBoolean(commonConfiguration["isUpload"])); browse = valuesGetter.GetBooleanPropertyValue("browse", Convert.ToBoolean(commonConfiguration["isBrowse"])); rewrite = valuesGetter.GetBooleanPropertyValue("rewrite", Convert.ToBoolean(commonConfiguration["isRewrite"])); }
/// <summary> /// Constructor. /// </summary> public CommonConfiguration() { YamlParser parser = new YamlParser(); dynamic configuration = parser.GetConfiguration("common"); ConfigurationValuesGetter valuesGetter = new ConfigurationValuesGetter(configuration); pageSelector = valuesGetter.GetBooleanPropertyValue("pageSelector", Convert.ToBoolean(commonConfiguration["isPageSelector"])); download = valuesGetter.GetBooleanPropertyValue("download", Convert.ToBoolean(commonConfiguration["isDownload"])); upload = valuesGetter.GetBooleanPropertyValue("upload", Convert.ToBoolean(commonConfiguration["isUpload"])); print = valuesGetter.GetBooleanPropertyValue("print", Convert.ToBoolean(commonConfiguration["isPrint"])); browse = valuesGetter.GetBooleanPropertyValue("browse", Convert.ToBoolean(commonConfiguration["isBrowse"])); rewrite = valuesGetter.GetBooleanPropertyValue("rewrite", Convert.ToBoolean(commonConfiguration["isRewrite"])); enableRightClick = valuesGetter.GetBooleanPropertyValue("enableRightClick", Convert.ToBoolean(commonConfiguration["enableRightClick"])); }
/// <summary> /// Constructor /// </summary> public EditorConfiguration() { YamlParser parser = new YamlParser(); dynamic configuration = parser.GetConfiguration("editor"); ConfigurationValuesGetter valuesGetter = new ConfigurationValuesGetter(configuration); // get Viewer configuration section from the web.config filesDirectory = valuesGetter.GetStringPropertyValue("filesDirectory", filesDirectory); if (!IsFullPath(filesDirectory)) { filesDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, filesDirectory); if (!Directory.Exists(filesDirectory)) { Directory.CreateDirectory(filesDirectory); } } fontsDirectory = valuesGetter.GetStringPropertyValue("fontsDirectory", fontsDirectory); defaultDocument = valuesGetter.GetStringPropertyValue("defaultDocument", defaultDocument); createNewFile = valuesGetter.GetBooleanPropertyValue("createNewFile", createNewFile); }
/// <summary> /// Initializes a new instance of the <see cref="ViewerConfiguration"/> class. /// </summary> public ViewerConfiguration() { YamlParser parser = new YamlParser(); dynamic configuration = parser.GetConfiguration("viewer"); ConfigurationValuesGetter valuesGetter = new ConfigurationValuesGetter(configuration); // get Viewer configuration section from the web.config this.filesDirectory = valuesGetter.GetStringPropertyValue("filesDirectory", this.filesDirectory); if (!IsFullPath(this.filesDirectory)) { this.filesDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, this.filesDirectory); if (!Directory.Exists(this.filesDirectory)) { Directory.CreateDirectory(this.filesDirectory); } } this.cacheFolderName = valuesGetter.GetStringPropertyValue("cacheFolderName", this.cacheFolderName); if (!IsFullPath(this.cacheFolderName)) { var cacheDirectory = Path.Combine(this.filesDirectory, this.cacheFolderName); if (!Directory.Exists(cacheDirectory)) { Directory.CreateDirectory(cacheDirectory); } } this.fontsDirectory = valuesGetter.GetStringPropertyValue("fontsDirectory", this.fontsDirectory); this.defaultDocument = valuesGetter.GetStringPropertyValue("defaultDocument", this.defaultDocument); this.preloadPageCount = valuesGetter.GetIntegerPropertyValue("preloadPageCount", this.preloadPageCount); this.zoom = valuesGetter.GetBooleanPropertyValue("zoom", this.zoom); this.search = valuesGetter.GetBooleanPropertyValue("search", this.search); this.thumbnails = valuesGetter.GetBooleanPropertyValue("thumbnails", this.thumbnails); this.rotate = valuesGetter.GetBooleanPropertyValue("rotate", this.rotate); this.htmlMode = valuesGetter.GetBooleanPropertyValue("htmlMode", this.htmlMode); this.cache = valuesGetter.GetBooleanPropertyValue("cache", this.cache); this.saveRotateState = valuesGetter.GetBooleanPropertyValue("saveRotateState", this.saveRotateState); this.watermarkText = valuesGetter.GetStringPropertyValue("watermarkText", this.watermarkText); this.printAllowed = valuesGetter.GetBooleanPropertyValue("printAllowed", this.printAllowed); this.showGridLines = valuesGetter.GetBooleanPropertyValue("showGridLines", this.showGridLines); }
/// <summary> /// Initializes a new instance of the <see cref="SearchConfiguration"/> class. /// Constructor. /// </summary> public SearchConfiguration() { YamlParser parser = new YamlParser(); // get Search configuration section from the web.config dynamic configuration = parser.GetConfiguration("search"); ConfigurationValuesGetter valuesGetter = new ConfigurationValuesGetter(configuration); this.filesDirectory = valuesGetter.GetStringPropertyValue("filesDirectory", this.filesDirectory); if (!DirectoryUtils.IsFullPath(this.filesDirectory)) { this.filesDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, this.filesDirectory); if (!Directory.Exists(this.filesDirectory)) { Directory.CreateDirectory(this.filesDirectory); } } this.indexDirectory = valuesGetter.GetStringPropertyValue("indexDirectory", this.indexDirectory); if (!DirectoryUtils.IsFullPath(this.indexDirectory)) { this.indexDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, this.indexDirectory); if (!Directory.Exists(this.indexDirectory)) { Directory.CreateDirectory(this.indexDirectory); } } this.indexedFilesDirectory = valuesGetter.GetStringPropertyValue("indexedFilesDirectory", this.indexedFilesDirectory); if (!DirectoryUtils.IsFullPath(this.indexedFilesDirectory)) { this.indexedFilesDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, this.indexedFilesDirectory); if (!Directory.Exists(this.indexedFilesDirectory)) { Directory.CreateDirectory(this.indexedFilesDirectory); } } }
/// <summary> /// Constructor /// </summary> public MetadataConfiguration() { YamlParser parser = new YamlParser(); dynamic configuration = parser.GetConfiguration("metadata"); ConfigurationValuesGetter valuesGetter = new ConfigurationValuesGetter(configuration); // get Metadata configuration section from the web.config filesDirectory = valuesGetter.GetStringPropertyValue("filesDirectory", filesDirectory); if (!DirectoryUtils.IsFullPath(filesDirectory)) { filesDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, filesDirectory); if (!Directory.Exists(filesDirectory)) { Directory.CreateDirectory(filesDirectory); } } defaultDocument = valuesGetter.GetStringPropertyValue("defaultDocument", defaultDocument); preloadPageCount = valuesGetter.GetIntegerPropertyValue("preloadPageCount", preloadPageCount); htmlMode = valuesGetter.GetBooleanPropertyValue("htmlMode", htmlMode); cache = valuesGetter.GetBooleanPropertyValue("cache", cache); browse = valuesGetter.GetBooleanPropertyValue("browse", browse); upload = valuesGetter.GetBooleanPropertyValue("upload", upload); }