예제 #1
0
파일: App.xaml.cs 프로젝트: mercaditu/ERP
        private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
        {
            if (e.Handled)
            {
                //Do Nothing
            }
            else
            {
                ExceptionBox           eBox   = new ExceptionBox();
                Menu.ApplicationWindow AppWin = Current.Windows.OfType <Window>().FirstOrDefault(x => x.IsActive) as Menu.ApplicationWindow;
                eBox.ex = e.Exception;

                eBox.Show();
                e.Handled = true;
            }
        }
예제 #2
0
        public void open_Report(object sender, RoutedEventArgs e)
        {
            cntrl.applicationIcon appName = (sender as cntrl.applicationIcon);

            string name = "Cognitivo.Reporting.Views." + appName.Uid;

            try
            {
                ApplicationWindow appWindow = new ApplicationWindow();
                appWindow.appName = name;
                appWindow.Title   = entity.Brillo.Localize.StringText(appName.Uid);
                appWindow.Icon    = appName.imgSource;
                appWindow.Show();
            }
            catch { }

            e.Handled = true;
        }
예제 #3
0
        public void open_App(object sender, RoutedEventArgs e)
        {
            cntrl.applicationIcon appName = (sender as cntrl.applicationIcon);
            string name = appName.Tag.ToString();

            if (Properties.Settings.Default.open_Window)
            {
                ApplicationWindow appWindow = new ApplicationWindow();
                appWindow.appName = name;
                appWindow.Title   = entity.Brillo.Localize.StringText(appName.Uid);
                appWindow.Icon    = appName.imgSource;
                appWindow.Show();
            }
            else
            {
                dynamic taskAuth = Task.Factory.StartNew(() => open_PageThread(name));
            }

            e.Handled = true;
        }
예제 #4
0
파일: App.xaml.cs 프로젝트: mercaditu/ERP
 private void HotkeyPressed(object sender, ExecutedRoutedEventArgs e)
 {
     //Code To Affect Current Window Only
     Menu.ApplicationWindow AppWin = Current.Windows.OfType <Window>().FirstOrDefault(x => x.IsActive && x.Name == "winApplicationWindow") as Menu.ApplicationWindow;
     if (AppWin != null)
     {
         System.Windows.Controls.Page contentPage = AppWin.mainFrame.Content as System.Windows.Controls.Page;
         if (contentPage != null)
         {
             cntrl.toolBar toolBar = contentPage.FindName("toolBar") as cntrl.toolBar;
             if (toolBar != null)
             {
                 string commandName = ((RoutedCommand)e.Command).Name;
                 if (commandName == "Save")
                 {
                     toolBar.btnSave_MouseUp(null, null);
                 }
                 if (commandName == "New")
                 {
                     toolBar.btnNew_MouseUp(null, null);
                 }
                 if (commandName == "DeleteMain")
                 {
                     toolBar.btnDelete_MouseUp(null, null);
                 }
                 if (commandName == "Cancel")
                 {
                     toolBar.btnCancel_MouseUp(null, null);
                 }
                 if (commandName == "Edit")
                 {
                     toolBar.btnEdit_MouseUp(null, null);
                 }
             }
         }
     }
 }