示例#1
0
        private static void Main( string[] args )
        {
            try
            {
                var argList = args.ToList();

                if ( argList.Count == 0 )
                {
                    Console.WriteLine( "USAGE: reimaginer input_file.xml /out:output_dir" );
                    return;
                }

                // TODO: when more filetypes are implemented, add functionality to automatically detect which one
                string outputPath = RetrieveArgument( argList, "out" );

                if ( argList.Count != 1 )
                {
                    throw new ArgumentException( "Must have exactly one input file" );
                }

                IConversationRenderer renderer = new HtmlRenderer( new FileWriter() );
                IMessageMapper mapper = new SmsMapper();

                string file = argList.First();
                MessageProcessor.Process( file, outputPath, mapper, renderer );
            }
            catch ( ArgumentException e )
            {
                Console.Error.WriteLine( "Error: {0}", e.Message );
            }
            catch ( Exception )
            {
                Console.Error.WriteLine( "An unhandled error occurred." );
            }
        }
示例#2
0
 public static void MapUpdate(Rate rate, RateDto dto)
 {
     rate.Name         = dto.Name;
     rate.Call         = CallMapper.Map(dto.Call);
     rate.Sms          = SmsMapper.Map(dto.Sms);
     rate.Internet     = InternetMapper.Map(dto.Internet);
     rate.Roaming      = RoamingMapper.Map(dto.Roaming);
     rate.HomeInternet = HomeInternetMapper.Map(dto.HomeInternet);
 }
示例#3
0
 public static Rate Map(RateDto dto)
 {
     return(new Rate
     {
         Id = dto.Id,
         Name = dto.Name,
         Call = CallMapper.Map(dto.Call),
         Sms = SmsMapper.Map(dto.Sms),
         Internet = InternetMapper.Map(dto.Internet),
         Roaming = RoamingMapper.Map(dto.Roaming),
         HomeInternet = HomeInternetMapper.Map(dto.HomeInternet),
     });
 }