public RenamingService(string fileNameFormat, string outputDirectory, bool replaceOriginals, ResizeSize size)
        {
            Debug.Assert(!String.IsNullOrWhiteSpace(fileNameFormat));
            Debug.Assert(fileNameFormat.Contains("{0}"));
            Debug.Assert(size != null);

            _fileNameFormat   = fileNameFormat;
            _outputDirectory  = outputDirectory;
            _replaceOriginals = replaceOriginals;
            _size             = size;
        }
Exemple #2
0
        public ResizingService(int qualityLevel, bool shrinkOnly, bool ignoreRotations, bool keepMetadata, ResizeSize size, RenamingService renamer)
        {
            Debug.Assert(qualityLevel >= 1 && qualityLevel <= 100);
            Debug.Assert(size != null);
            Debug.Assert(renamer != null);

            _qualityLevel    = qualityLevel;
            _shrinkOnly      = shrinkOnly;
            _ignoreRotations = ignoreRotations;
            _size            = size;
            _renamer         = renamer;
            _keepMetadata    = keepMetadata;
        }
 private ResizingService CreateResizer(ResizeSize size, int qualityLevel = 75, bool shrinkOnly = false, bool ignoreRotations = true, bool keepMetadata = false)
 {
     return(new ResizingService(
                qualityLevel,
                shrinkOnly,
                ignoreRotations,
                keepMetadata,
                size,
                new RenamingService(
                    "{0} ({1})",
                    null,
                    false,
                    size)));
 }
 public void RemoveSize(ResizeSize size)
 => Settings.Sizes.Remove(size);