示例#1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            try
            {
                ApplicationStartup.Start();
                var mainPresenter = IoC.Resolve <IBatchMainPresenter>();
                Application.Run(mainPresenter.BaseView.DowncastTo <Form>());
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ExceptionMessageWithStackTrace(), "Unhandled Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
        public static void Start()
        {
            ApplicationStartup.Initialize();
            var container = IoC.Container;

            using (container.OptimizeDependencyResolution())
            {
                container.AddRegister(x => x.FromType <CoreRegister>());
                container.AddRegister(x => x.FromType <PresenterRegister>());
                container.AddRegister(x => x.FromType <InfrastructureRegister>());
                container.AddRegister(x => x.FromType <BatchRegister>());

                InfrastructureRegister.RegisterSerializationDependencies();
                ApplicationStartup.RegisterCommands(container);

                var workspace = container.Resolve <IWorkspace>();
                container.RegisterImplementationOf((IWithWorkspaceLayout)workspace);
            }
        }