Exemplo n.º 1
0
        private IList <ImageOutputProperties> CreateFromJson(string json, string extension, string rootPath)
        {
            var         imagesOutputProperties = ImageOutputPropertiesFactory.CreateListFromJson(json);
            ImageFormat imageFormat            = new ImageFormat(extension);

            foreach (var imageOutputProperties in imagesOutputProperties)
            {
                imageOutputProperties.FolderPath.IsAbsolute = true;
                imageOutputProperties.FolderPath.Path       = string.Concat(rootPath, "\\", imageOutputProperties.FolderPath.Path);
                imageOutputProperties.ImageFormat           = imageFormat;
            }

            return(imagesOutputProperties);
        }
Exemplo n.º 2
0
        private IEnumerable <ImageProperties> CreateImageProperties()
        {
            var imagesProperties = new List <ImageProperties>();

            foreach (string path in ListBoxFiles.Items)
            {
                imagesProperties.Add(new ImageProperties()
                {
                    FileName = Path.GetFileNameWithoutExtension(path),
                    Image    = File.ReadAllBytes(path),
                    ImageOutputProperties = this.CheckBoxCustomFormat.IsChecked.GetValueOrDefault()?
                                            ImageOutputPropertiesFactory.CreateListFromJson(File.ReadAllText(this.TextBoxCustomFormat.Text)):
                                            ImageOutputPropertiesFactory.CreateForXamarin(Path.GetExtension(path), this.TextBoxOutput.Text)
                });
            }

            return(imagesProperties);
        }