public static void Main(string[] args) { Console.WriteLine(""); if (args.Length < 2) { usage(); } mapObj m_obj = new mapObj(args[0]); if (args.Length >= 3) { Console.WriteLine("Setting the imagetype to " + args[2]); m_obj.setImageType(args[2]); } Console.WriteLine("# Map layers " + m_obj.numlayers + "; Map name = " + m_obj.name); for (int i = 0; i < m_obj.numlayers; i++) { Console.WriteLine("Layer [" + i + "] name: " + m_obj.getLayer(i).name); } imageObj i_obj = m_obj.draw(); Console.WriteLine("Image URL = " + i_obj.imageurl + "; Image path = " + i_obj.imagepath); Console.WriteLine("Image height = " + i_obj.height + "; width = " + i_obj.width); try { i_obj.save(args[1], m_obj); } catch (Exception ex) { Console.WriteLine("\nMessage ---\n{0}", ex.Message); Console.WriteLine( "\nHelpLink ---\n{0}", ex.HelpLink); Console.WriteLine("\nSource ---\n{0}", ex.Source); Console.WriteLine( "\nStackTrace ---\n{0}", ex.StackTrace); Console.WriteLine( "\nTargetSite ---\n{0}", ex.TargetSite); } }
public static void Main(string[] args) { Console.WriteLine(""); if (args.Length < 2) usage(); mapObj m_obj = new mapObj(args[0]); if (args.Length >= 3) { Console.WriteLine("Setting the imagetype to " + args[2]); m_obj.setImageType(args[2]); } Console.WriteLine ("# Map layers " + m_obj.numlayers + "; Map name = " + m_obj.name); for (int i=0; i<m_obj.numlayers; i++) { Console.WriteLine("Layer [" + i + "] name: " + m_obj.getLayer(i).name); } imageObj i_obj = m_obj.draw(); Console.WriteLine("Image URL = " + i_obj.imageurl + "; Image path = " + i_obj.imagepath); Console.WriteLine("Image height = " + i_obj.height + "; width = " + i_obj.width); try { i_obj.save(args[1],m_obj); } catch (Exception ex) { Console.WriteLine( "\nMessage ---\n{0}", ex.Message ); Console.WriteLine( "\nHelpLink ---\n{0}", ex.HelpLink ); Console.WriteLine( "\nSource ---\n{0}", ex.Source ); Console.WriteLine( "\nStackTrace ---\n{0}", ex.StackTrace ); Console.WriteLine( "\nTargetSite ---\n{0}", ex.TargetSite ); } }