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