static void Main(string[] args) { // If file name is present, convert quiet and exit if (args.Length > 0) { string filename = args[0]; mm2mConverter conv = new mm2mConverter(); conv.ReadFile(filename); conv.WriteFile(Path.GetFileNameWithoutExtension(filename) + "_metric.stc"); Environment.Exit(0); } // starts windows form application Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // locales management string localeName = ConfigurationManager.AppSettings["locale"]; CultureInfo locale; if (string.IsNullOrWhiteSpace(localeName)) { locale = CultureInfo.CurrentCulture; } else { locale = new CultureInfo(localeName); } Application.Run(new mm2mForm(Assembly.GetExecutingAssembly(), locale)); }
/// <summary> /// Save dirty work /// </summary> /// <param name="filename">File to save on</param> protected override void doSave(string filename) { if (conv != null) { base.doSave(filename); conv.WriteFile(filename); } }