コード例 #1
0
ファイル: Program.cs プロジェクト: ctukc-nt/UPPY
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            AutoMapper.Mapper.CreateMap<Drawing, HierarchyNumberDrawing>();
            CompositionRoot.Wire(new ApplicationModule());
            var uppyFactory = CompositionRoot.Resolve<IUppyControllersFactory>();
            var mainForm = new MainForm(uppyFactory);

            Application.Run(mainForm);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: ctukc-nt/UPPY_v2
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Mapper.CreateMap<Drawing, HierarchyNumberDrawing>();
            Mapper.CreateMap<HierarchyNumberDrawing, Drawing>();

            CompositionRoot.Wire(new ApplicationModule());
            var uppyFactory = CompositionRoot.Resolve<IUppyControllersFactory>();
            var rolesChecker = CompositionRoot.Resolve<IRolesChecker>();
            var autService = CompositionRoot.Resolve<IAuthorizationService>();

            if (autService.GetCredential() != null)
            {
                uppyFactory.RoleChecker = rolesChecker;
                var mainForm = new MainForm(uppyFactory);
                Application.Run(mainForm);
            }
            else
            {
                MessageBox.Show("Вы не авторизованы для работы с данной программой.");
            }
        }