Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AnnotationConfiguration"/> class.
        /// Get Annotation configuration section from the Web.config.
        /// </summary>
        public AnnotationConfiguration()
        {
            YamlParser parser        = new YamlParser();
            dynamic    configuration = parser.GetConfiguration("annotation");
            ConfigurationValuesGetter valuesGetter = new ConfigurationValuesGetter(configuration);

            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.defaultDocument              = valuesGetter.GetStringPropertyValue("defaultDocument", this.defaultDocument).Replace(@"\", "/");
            this.textAnnotation               = valuesGetter.GetBooleanPropertyValue("textAnnotation", this.textAnnotation);
            this.areaAnnotation               = valuesGetter.GetBooleanPropertyValue("areaAnnotation", this.areaAnnotation);
            this.pointAnnotation              = valuesGetter.GetBooleanPropertyValue("pointAnnotation", this.pointAnnotation);
            this.textStrikeoutAnnotation      = valuesGetter.GetBooleanPropertyValue("textStrikeoutAnnotation", this.textStrikeoutAnnotation);
            this.polylineAnnotation           = valuesGetter.GetBooleanPropertyValue("polylineAnnotation", this.polylineAnnotation);
            this.textFieldAnnotation          = valuesGetter.GetBooleanPropertyValue("textFieldAnnotation", this.textFieldAnnotation);
            this.watermarkAnnotation          = valuesGetter.GetBooleanPropertyValue("watermarkAnnotation", this.watermarkAnnotation);
            this.textReplacementAnnotation    = valuesGetter.GetBooleanPropertyValue("textReplacementAnnotation", this.textReplacementAnnotation);
            this.arrowAnnotation              = valuesGetter.GetBooleanPropertyValue("arrowAnnotation", this.arrowAnnotation);
            this.textRedactionAnnotation      = valuesGetter.GetBooleanPropertyValue("textRedactionAnnotation", this.textRedactionAnnotation);
            this.resourcesRedactionAnnotation = valuesGetter.GetBooleanPropertyValue("resourcesRedactionAnnotation", this.resourcesRedactionAnnotation);
            this.textUnderlineAnnotation      = valuesGetter.GetBooleanPropertyValue("textUnderlineAnnotation", this.textUnderlineAnnotation);
            this.distanceAnnotation           = valuesGetter.GetBooleanPropertyValue("distanceAnnotation", this.distanceAnnotation);
            this.downloadOriginal             = valuesGetter.GetBooleanPropertyValue("downloadOriginal", this.downloadOriginal);
            this.downloadAnnotated            = valuesGetter.GetBooleanPropertyValue("downloadAnnotated", this.downloadAnnotated);
            this.preloadPageCount             = valuesGetter.GetIntegerPropertyValue("preloadPageCount", this.preloadPageCount);
            this.zoom = valuesGetter.GetBooleanPropertyValue("zoom", this.zoom);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public ConversionConfiguration()
        {
            YamlParser parser        = new YamlParser();
            dynamic    configuration = parser.GetConfiguration("conversion");
            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);
                }
            }
            ResultDirectory = valuesGetter.GetStringPropertyValue("resultDirectory", ResultDirectory);
            if (!IsFullPath(ResultDirectory))
            {
                ResultDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ResultDirectory);
                if (!Directory.Exists(ResultDirectory))
                {
                    Directory.CreateDirectory(ResultDirectory);
                }
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public ComparisonConfiguration()
        {
            YamlParser parser        = new YamlParser();
            dynamic    configuration = parser.GetConfiguration("comparison");
            ConfigurationValuesGetter valuesGetter = new ConfigurationValuesGetter(configuration);

            // get Comparison 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);
                }
            }
            resultDirectory = valuesGetter.GetStringPropertyValue("resultDirectory", resultDirectory);
            if (!IsFullPath(resultDirectory))
            {
                resultDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, resultDirectory);
                if (!Directory.Exists(resultDirectory))
                {
                    Directory.CreateDirectory(resultDirectory);
                }
            }
            preloadResultPageCount = valuesGetter.GetIntegerPropertyValue("preloadResultPageCount", preloadResultPageCount);
        }
        /// <summary>
        /// Get annotation configuration section from the Web.config
        /// </summary>
        public AnnotationConfiguration()
        {
            YamlParser parser        = new YamlParser();
            dynamic    configuration = parser.GetConfiguration("annotation");
            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);
                }
            }
            OutputDirectory                = valuesGetter.GetStringPropertyValue("outputDirectory", OutputDirectory);
            isTextAnnotation               = valuesGetter.GetBooleanPropertyValue("textAnnotation", isTextAnnotation);
            isAreaAnnotation               = valuesGetter.GetBooleanPropertyValue("areaAnnotation", isAreaAnnotation);
            isPointAnnotation              = valuesGetter.GetBooleanPropertyValue("pointAnnotation", isPointAnnotation);
            isTextStrikeoutAnnotation      = valuesGetter.GetBooleanPropertyValue("textStrikeoutAnnotation", isTextStrikeoutAnnotation);
            isPolylineAnnotation           = valuesGetter.GetBooleanPropertyValue("polylineAnnotation", isPolylineAnnotation);
            isTextFieldAnnotation          = valuesGetter.GetBooleanPropertyValue("textFieldAnnotation", isTextFieldAnnotation);
            isWatermarkAnnotation          = valuesGetter.GetBooleanPropertyValue("watermarkAnnotation", isWatermarkAnnotation);
            isTextReplacementAnnotation    = valuesGetter.GetBooleanPropertyValue("textReplacementAnnotation", isTextReplacementAnnotation);
            isArrowAnnotation              = valuesGetter.GetBooleanPropertyValue("arrowAnnotation", isArrowAnnotation);
            isTextRedactionAnnotation      = valuesGetter.GetBooleanPropertyValue("textRedactionAnnotation", isTextRedactionAnnotation);
            isResourcesRedactionAnnotation = valuesGetter.GetBooleanPropertyValue("resourcesRedactionAnnotation", isResourcesRedactionAnnotation);
            isTextUnderlineAnnotation      = valuesGetter.GetBooleanPropertyValue("textUnderlineAnnotation", isTextUnderlineAnnotation);
            isDistanceAnnotation           = valuesGetter.GetBooleanPropertyValue("distanceAnnotation", isDistanceAnnotation);
            isDownloadOriginal             = valuesGetter.GetBooleanPropertyValue("downloadOriginal", isDownloadOriginal);
            isDownloadAnnotated            = valuesGetter.GetBooleanPropertyValue("downloadAnnotated", isDownloadAnnotated);
            PreloadPageCount               = valuesGetter.GetIntegerPropertyValue("preloadPageCount", PreloadPageCount);
        }
        /// <summary>
        /// Get Signature configuration section from the Web.config
        /// </summary>
        public SignatureConfiguration()
        {
            YamlParser parser        = new YamlParser();
            dynamic    configuration = parser.GetConfiguration("signature");
            ConfigurationValuesGetter valuesGetter = new ConfigurationValuesGetter(configuration);

            filesDirectory = valuesGetter.GetStringPropertyValue("filesDirectory", filesDirectory);
            if (!IsFullPath(filesDirectory))
            {
                filesDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, filesDirectory);
                if (!Directory.Exists(filesDirectory))
                {
                    Directory.CreateDirectory(filesDirectory);
                }
            }

            dataDirectory    = valuesGetter.GetStringPropertyValue("dataDirectory", dataDirectory);
            defaultDocument  = valuesGetter.GetStringPropertyValue("defaultDocument", defaultDocument);
            textSignature    = valuesGetter.GetBooleanPropertyValue("textSignature", textSignature);
            imageSignature   = valuesGetter.GetBooleanPropertyValue("imageSignature", imageSignature);
            digitalSignature = valuesGetter.GetBooleanPropertyValue("digitalSignature", digitalSignature);
            qrCodeSignature  = valuesGetter.GetBooleanPropertyValue("qrCodeSignature", qrCodeSignature);
            barCodeSignature = valuesGetter.GetBooleanPropertyValue("barCodeSignature", barCodeSignature);
            stampSignature   = valuesGetter.GetBooleanPropertyValue("stampSignature", stampSignature);
            handSignature    = valuesGetter.GetBooleanPropertyValue("handSignature", handSignature);
            downloadOriginal = valuesGetter.GetBooleanPropertyValue("downloadOriginal", downloadOriginal);
            downloadSigned   = valuesGetter.GetBooleanPropertyValue("downloadSigned", downloadSigned);
            preloadPageCount = valuesGetter.GetIntegerPropertyValue("preloadPageCount", preloadPageCount);
            zoom             = valuesGetter.GetBooleanPropertyValue("zoom", zoom);
        }
Exemple #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SignatureConfiguration"/> class.
        /// Get signature configuration section from the Web.config.
        /// </summary>
        public SignatureConfiguration()
        {
            YamlParser parser        = new YamlParser();
            dynamic    configuration = parser.GetConfiguration("signature");
            ConfigurationValuesGetter valuesGetter = new ConfigurationValuesGetter(configuration);

            // get Comparison 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.dataDirectory    = valuesGetter.GetStringPropertyValue("dataDirectory", this.dataDirectory);
            this.defaultDocument  = valuesGetter.GetStringPropertyValue("defaultDocument", this.defaultDocument);
            this.textSignature    = valuesGetter.GetBooleanPropertyValue("textSignature", this.textSignature);
            this.imageSignature   = valuesGetter.GetBooleanPropertyValue("imageSignature", this.imageSignature);
            this.digitalSignature = valuesGetter.GetBooleanPropertyValue("digitalSignature", this.digitalSignature);
            this.qrCodeSignature  = valuesGetter.GetBooleanPropertyValue("qrCodeSignature", this.qrCodeSignature);
            this.barCodeSignature = valuesGetter.GetBooleanPropertyValue("barCodeSignature", this.barCodeSignature);
            this.stampSignature   = valuesGetter.GetBooleanPropertyValue("stampSignature", this.stampSignature);
            this.handSignature    = valuesGetter.GetBooleanPropertyValue("handSignature", this.handSignature);
            this.downloadOriginal = valuesGetter.GetBooleanPropertyValue("downloadOriginal", this.downloadOriginal);
            this.downloadSigned   = valuesGetter.GetBooleanPropertyValue("downloadSigned", this.downloadSigned);
            this.preloadPageCount = valuesGetter.GetIntegerPropertyValue("preloadPageCount", this.preloadPageCount);
            this.zoom             = valuesGetter.GetBooleanPropertyValue("zoom", this.zoom);
        }
        /// <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);
            filesDirectory = InitDirectory(filesDirectory);

            outputDirectory = valuesGetter.GetStringPropertyValue("outputDirectory", outputDirectory);
            outputDirectory = InitDirectory(outputDirectory);

            tempDirectory = valuesGetter.GetStringPropertyValue("tempDirectory", tempDirectory);
            tempDirectory = InitDirectory(tempDirectory);

            defaultDocument         = valuesGetter.GetStringPropertyValue("defaultDocument", defaultDocument);
            preloadPageCount        = valuesGetter.GetIntegerPropertyValue("preloadPageCount", preloadPageCount);
            previewTimeLimit        = valuesGetter.GetIntegerPropertyValue("previewTimeLimit", previewTimeLimit);
            htmlMode                = valuesGetter.GetBooleanPropertyValue("htmlMode", htmlMode);
            cache                   = valuesGetter.GetBooleanPropertyValue("cache", cache);
            browse                  = valuesGetter.GetBooleanPropertyValue("browse", browse);
            upload                  = valuesGetter.GetBooleanPropertyValue("upload", upload);
            fileOperationTimeout    = valuesGetter.GetIntegerPropertyValue("fileOperationTimeout", fileOperationTimeout);
            fileOperationRetryCount = valuesGetter.GetIntegerPropertyValue("fileOperationRetryCount", fileOperationRetryCount);
        }
Exemple #8
0
        /// <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);
        }
Exemple #10
0
        /// <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);
        }