public static void Main(string[] args) { Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.ThreadException += OnException; try { var appSetting = ConfigurationManager.AppSettings["debug"]; if (appSetting != null && appSetting.ToLower() == "true") { Debugger.Break(); } var pathInfo = new PathInfo(args); Tracing.Tracer.LogSeparator("PathInfo"); Tracing.Tracer.LogText(pathInfo.ToString()); Tracing.Tracer.LogSeparator("PathInfo"); CheckAssemblyFile(pathInfo); var modelControllerBuilder = new ModelControllerBuilder(); var settingsStorageOnRegistry = new SettingsStorageOnRegistry(@"Software\Developer Express\eXpressApp Framework\Model Editor"); modelEditorForm = new ModelEditorForm(modelControllerBuilder.GetController(pathInfo), settingsStorageOnRegistry); modelEditorForm.Disposed += (sender, eventArgs) => ((IModelEditorSettings)modelEditorForm).ModelEditorSaveSettings(); modelEditorForm.SetCaption(Path.GetFileName(pathInfo.LocalPath)); Application.Run(modelEditorForm); } catch (Exception exception) { HandleException(exception); } }
public static void Main(string[] args) { Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.ThreadException += OnException; try { var strings = args; if (args.Length > 4 && args[0] == "d") { MessageBox.Show( $"Attach to {Path.GetFileName(AppDomain.CurrentDomain.SetupInformation.ApplicationBase)}"); strings = args.Skip(1).ToArray(); } var pathInfo = new PathInfo(strings); Tracing.Tracer.LogSeparator("PathInfo"); Tracing.Tracer.LogText(pathInfo.ToString()); Tracing.Tracer.LogSeparator("PathInfo"); CheckAssemblyFile(pathInfo); var modelControllerBuilder = new ModelControllerBuilder(); var settingsStorageOnRegistry = new SettingsStorageOnRegistry(@"Software\Developer Express\eXpressApp Framework\Model Editor"); var modelEditorViewController = modelControllerBuilder.GetController(pathInfo); Tracing.Tracer.LogText("modelEditorViewController"); WinSimpleActionBinding.Register(); WinSingleChoiceActionBinding.Register(); WinParametrizedActionBinding.Register(); PopupWindowShowActionBinding.Register(); _modelEditorForm = new ModelEditorForm(modelEditorViewController, settingsStorageOnRegistry); _modelEditorForm.Disposed += (sender, eventArgs) => ((IModelEditorSettings)sender).ModelEditorSaveSettings(); _modelEditorForm.SetCaption(Path.GetFileName(pathInfo.LocalPath)); Application.Run(_modelEditorForm); } catch (Exception exception) { HandleException(exception); } }
public static void Main(string[] args) { Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.ThreadException += OnException; try { var appSetting = ConfigurationManager.AppSettings["debug"]; if (appSetting != null && appSetting.ToLower() == "true") { MessageBox.Show("Attach to this proccess"); } var pathInfo = new PathInfo(args); Tracing.Tracer.LogSeparator("PathInfo"); Tracing.Tracer.LogText(pathInfo.ToString()); Tracing.Tracer.LogSeparator("PathInfo"); CheckAssemblyFile(pathInfo); var modelControllerBuilder = new ModelControllerBuilder(); var settingsStorageOnRegistry = new SettingsStorageOnRegistry(@"Software\Developer Express\eXpressApp Framework\Model Editor"); _modelEditorForm = new ModelEditorForm(modelControllerBuilder.GetController(pathInfo), settingsStorageOnRegistry); _modelEditorForm.Disposed += (sender, eventArgs) => ((IModelEditorSettings)_modelEditorForm).ModelEditorSaveSettings(); _modelEditorForm.SetCaption(Path.GetFileName(pathInfo.LocalPath)); Application.Run(_modelEditorForm); } catch (Exception exception) { HandleException(exception); } }
public static void Main(string[] args) { Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.ThreadException += OnException; try { var strings = args; if (args.Length>3&&args[0]=="d"){ MessageBox.Show("Attach to this proccess"); strings = args.Skip(1).ToArray(); } var pathInfo = new PathInfo(strings); Tracing.Tracer.LogSeparator("PathInfo"); Tracing.Tracer.LogText(pathInfo.ToString()); Tracing.Tracer.LogSeparator("PathInfo"); CheckAssemblyFile(pathInfo); var modelControllerBuilder = new ModelControllerBuilder(); var settingsStorageOnRegistry = new SettingsStorageOnRegistry(@"Software\Developer Express\eXpressApp Framework\Model Editor"); _modelEditorForm = new ModelEditorForm(modelControllerBuilder.GetController(pathInfo), settingsStorageOnRegistry); _modelEditorForm.Disposed += (sender, eventArgs) => ((IModelEditorSettings)_modelEditorForm).ModelEditorSaveSettings(); _modelEditorForm.SetCaption(Path.GetFileName(pathInfo.LocalPath)); Application.Run(_modelEditorForm); } catch (Exception exception) { HandleException(exception); } }
public static void Main(string[] args) { var iconName = typeof(MainClass).Assembly.GetManifestResourceNames().First(s => s.EndsWith("ExpressApp.ico")); var manifestResourceStream = typeof(MainClass).Assembly.GetManifestResourceStream(iconName); var icon = new Icon(manifestResourceStream ?? throw new InvalidOperationException()); Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.ThreadException += OnException; SplashScreen splashScreen = null; try { var strings = args; if (args.Length > 4 && args[0] == "d") { MessageBox.Show( $"Attach to {Path.GetFileName(AppDomain.CurrentDomain.SetupInformation.ApplicationBase)}"); strings = args.Skip(1).ToArray(); } DesignerOnlyCalculator.IsRunFromDesigner = true; splashScreen = new SplashScreen(); splashScreen.Start(); var pathInfo = new PathInfo(strings); Tracing.Tracer.LogSeparator("PathInfo"); Tracing.Tracer.LogText(pathInfo.ToString()); Tracing.Tracer.LogSeparator("PathInfo"); CheckAssemblyFile(pathInfo); var modelControllerBuilder = new ModelControllerBuilder(); var settingsStorageOnRegistry = new SettingsStorageOnRegistry(@"Software\Developer Express\eXpressApp Framework\Model Editor"); var modelEditorViewController = modelControllerBuilder.GetController(pathInfo); Tracing.Tracer.LogText("modelEditorViewController"); WinSimpleActionBinding.Register(); WinSingleChoiceActionBinding.Register(); WinParametrizedActionBinding.Register(); PopupWindowShowActionBinding.Register(); _modelEditorForm = new ModelEditorForm(modelEditorViewController, settingsStorageOnRegistry); _modelEditorForm.Shown += (sender, eventArgs) => splashScreen?.Stop(); _modelEditorForm.Disposed += (sender, eventArgs) => ((IModelEditorSettings)sender)?.ModelEditorSaveSettings(); _modelEditorForm.SetCaption($"{Path.GetFileNameWithoutExtension(pathInfo.AssemblyPath)}/{Path.GetFileName(pathInfo.LocalPath)}"); _modelEditorForm.Icon = icon; Application.Run(_modelEditorForm); } catch (Exception exception) { HandleException(exception); } finally { splashScreen?.Stop(); } }
public static void Main(string[] args) { Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.ThreadException += OnException; try { var pathInfo = new PathInfo(args); Tracing.Tracer.LogSeparator("PathInfo"); Tracing.Tracer.LogText(pathInfo.ToString()); Tracing.Tracer.LogSeparator("PathInfo"); CheckAssemblyFile(pathInfo); var modelControllerBuilder = new ModelControllerBuilder(); var settingsStorageOnRegistry = new SettingsStorageOnRegistry(@"Software\Developer Express\eXpressApp Framework\Model Editor"); modelEditorForm = new ModelEditorForm(modelControllerBuilder.GetController(pathInfo), settingsStorageOnRegistry); modelEditorForm.Disposed += (sender, eventArgs) => ((IModelEditorSettings)modelEditorForm).ModelEditorSaveSettings(); modelEditorForm.SetCaption(Path.GetFileName(pathInfo.LocalPath)); Application.Run(modelEditorForm); } catch (Exception exception) { HandleException(exception); } }
public ModelEditFormShowningEventArgs(ModelEditorForm modelEditorForm) { ModelEditorForm = modelEditorForm; }
static void Main(string[] args) { Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.ThreadException += new ThreadExceptionEventHandler(OnException); if (args.Length == 0 ||args.Length > 2) { MessageBox.Show(string.Format("Usage: {0}'{1}' <Path_to_app_config_file> {0} '{1}' <Path_to_dll_file> <Path_to_diff_file>", Environment.NewLine, Environment.GetCommandLineArgs()[0]), ModelEditorForm.Title, MessageBoxButtons.OK, MessageBoxIcon.Error); } else { try { args[0] = args[0].TrimStart('"').TrimEnd('"'); args[1] = args[1].TrimStart('"').TrimEnd('"'); string targetPath = args[0]; string diffsPath = (args.Length == 2 ? args[1] : string.Empty); if (Path.GetExtension(targetPath).ToLower() != ".config" && Path.GetExtension(targetPath).ToLower() != ".dll") { throw new Exception("This file can be executed with a configuration or an assebly file as a parameter."); } if(!File.Exists(targetPath)) { targetPath = Path.Combine(System.Environment.CurrentDirectory, targetPath); if(!File.Exists(targetPath)) { throw new Exception(String.Format("The config file '{0}' couldn't be found.", targetPath)); } } if (diffsPath == string.Empty) { diffsPath = Path.GetDirectoryName(targetPath); } if(diffsPath == string.Empty) { diffsPath = System.Environment.CurrentDirectory; } DesignerModelFactory dmf = new DesignerModelFactory(); ApplicationModulesManager mgr = dmf.CreateModelManager(targetPath, diffsPath); mgr.Load(); var controller = new ModelEditorController(mgr.Model, mgr.LastDiffsStore, mgr.Modules); modelEditorForm = new ModelEditorForm(controller, new SettingsStorageOnRegistry(@"Software\Developer Express\eXpressApp Framework\Model Editor")); modelEditorForm.SetCaption(Path.GetFileName(targetPath)); Application.Run(modelEditorForm); } catch(Exception exception) { HandleException(exception); } } }