示例#1
0
        public void Execute(object parameter)
        {
            var openFileDialog = new OpenFileDialog
            {
                Filter      = Constants.FileFilter,
                Multiselect = false
            };

            if (openFileDialog.ShowDialog() == true)
            {
                var reader = new MappingsSourceReader();
                var source = reader.Read(openFileDialog.FileName);

                MappingsSource = new MappingsSourceViewModel
                {
                    FileName = openFileDialog.FileName,

                    Mappings = new MappingsCollection(source.Mappings)
                };
            }
        }
示例#2
0
        private static void MapFiles(string[] arguments)
        {
            SetOutptDirectory(arguments);

            var reader = new MappingsSourceReader();

            var mappingSource = reader.Read(
                arguments.GetArgumentValue(Argument.MappingsArgument, "mappings.txt"));

            var mapper = new Mapper();

            if (arguments.HasArgumentValue(Argument.UndoArgument))
            {
                mapper.Direction = MappinDirection.Reverse;
            }

            mapper.Map(mappingSource);

            _logger.Log(LoggingLevel.Info, "{0} files mapped from the instructions foudn in {1}",
                        mapper.MappedFiles, mappingSource.FullName);
        }