Exemplo n.º 1
0
        public MainForm(ViewModel viewModel)
        {
            InitializeComponent();

            ApplicationEnvironment.LanguageChanged -= OnLanguageChanged;
            ApplicationEnvironment.LanguageChanged += OnLanguageChanged;

            this.viewModel = viewModel;
            labelCurrentUser.Text = ApplicationEnvironment.UserName;
            //InitTree();
        }
Exemplo n.º 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ViewModel viewModel = new ViewModel();

            if (viewModel.CanLogin())
            {
                Application.Run(new MainForm(viewModel));
            }
            else
            {
                MessageBox.Show(ApplicationEnvironment.GetString("UserInvalid"), ApplicationEnvironment.GetString("Error"), MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }