Exemplo n.º 1
0
Arquivo: Main.cs Projeto: noxe/eXpand
        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);
            }

        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
        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);
            }

        }
Exemplo n.º 5
0
        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();
            }
        }
Exemplo n.º 6
0
        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);
            }
        }