예제 #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("Вы не авторизованы для работы с данной программой.");
            }
        }