public override void Execute(PackAnimationCommand command, TextWriter @out)
        {
            var spriteSheetConfig = _merger.MergeFor <ImageRgba32>
                                        (command.InputDirectory,
                                        new MergeOptions(
                                            command.InputFileParsingPattern,
                                            false,
                                            command.MaxWidth,
                                            command.MaxWidth,
                                            0, 0,
                                            string.IsNullOrWhiteSpace(command.PackedName) == false));

            var validator = new SpriteSheetConfigValidator(command.InputFileParsingPattern);

            if (validator.Validate(spriteSheetConfig) == false)
            {
                throw new AnimationFileNameNotMatchPatternException();
            }

            var    animationSheet = AnitationSpriteSheet.Create(spriteSheetConfig, command.InputFileParsingPattern);
            string sheetFileName  = DetermineSheetName(command, spriteSheetConfig);

            _persistor.Save(
                _serializer.SerializeToXmlString(animationSheet),
                spriteSheetConfig.Image,
                command.OutputDirectory,
                sheetFileName,
                command.ImageFileExtension);
        }
        public override void Execute(PackSpritesheetCommand command, TextWriter @out)
        {
            var spriteSheetConfig = _merger.MergeFor <ImageRgba32>
                                        (command.InputDirectory,
                                        new MergeOptions(
                                            string.Empty,
                                            false,
                                            command.MaxWidth,
                                            command.MaxWidth,
                                            0, 0,
                                            string.IsNullOrWhiteSpace(command.PackedName) == false));

            var    animationSheet = SpriteSheet.Create(spriteSheetConfig);
            string sheetFileName  = DetermineSheetName(command.PackedName);

            _persistor.Save(
                _serializer.SerializeToXmlString(animationSheet),
                spriteSheetConfig.Image,
                command.OutputDirectory,
                sheetFileName,
                command.ImageFileExtension);
        }