private bool OpenWindow(string controlName, string title = "Public Window")
        {
            Dispatcher.BeginInvoke(new Action(() =>
            {
                string namespaceName = "ES.UI.Setups";
                TryCatch.BeginTryCatch(() =>
                {
                    MainWindow main = (MainWindow)Utilities.GetMainWindow();
                    if (main != null && main.MainContainer != null)
                    {
                        var myObj = Activator.CreateInstance(Type.GetType(namespaceName + "." + controlName));

                        if (main.MainContainer.Content == null || MainWinContainer.MainWindowContainerContent.Content == null ||
                            (myObj != null && MainWinContainer.MainWindowContainerContent.Content.GetType().Name != myObj.GetType().Name))
                        {
                            MainWinContainer.WindowTitle.Text = title;
                            MainWinContainer.MainWindowContainerContent.Content = myObj;
                            main.MainContainer.Content = MainWinContainer;
                        }
                    }
                });
            }));

            return(true);
        }
 public void OpenPopUp(BaseUserControl control, string title = "Testing Window", int width = 300, int height = 300)
 {
     TryCatch.BeginTryCatch(new Action(() => {
         PopUpWindow ne = new PopUpWindow(control, title, width, height);
         ne.ShowDialog();
     }));
 }
Exemplo n.º 3
0
 private void ExportClick(object sender, System.Windows.RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(txtPdfFileLocation.Text))
     {
         return;
     }
     TryCatch.BeginTryCatch(() => grid.ExportToPdf(txtPdfFileLocation.Text, (ExcelTableStyle)style.SelectedValue, true));
 }
 private void ExportClick(object sender, System.Windows.RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(txtCsvFileLocation.Text))
     {
         return;
     }
     TryCatch.BeginTryCatch(() => grid.ExportToCsv("Test", txtCsvFileLocation.Text, true));
 }
Exemplo n.º 5
0
 private void ButtonClick(object sender, System.Windows.RoutedEventArgs e)
 {
     TryCatch.BeginTryCatch(() =>
     {
         var sd    = new SaveFileDialog();
         sd.Filter = "Excel documents (*.xls, *.xlsx)|*.xls;*.xlsx";
         sd.ShowDialog();
         if (!string.IsNullOrEmpty(sd.FileName))
         {
             txtExcelFileLocation.Text = sd.FileName;
         }
     });
 }
Exemplo n.º 6
0
 void TimerElapsed(object sender, ElapsedEventArgs e)
 {
     TryCatch.BeginTryCatch(() =>
     {
         _counter         = _counter + 20;
         ProgressBarValue = (double)_counter / Max * 100;
         if (_counter != Max)
         {
             return;
         }
         _timer.Stop();
         _timer.Dispose();
     });
 }
 private void WindowLoaded(object sender, System.Windows.RoutedEventArgs e)
 {
     TryCatch.BeginTryCatch(() =>
     {
         if (ApplicationDeployment.IsNetworkDeployed)
         {
             txtVersion.Text = ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString();
         }
         else
         {
             txtVersion.Text = Application.ProductVersion;
         }
     }
                            );
 }
Exemplo n.º 8
0
 private void btnExportToPDF_Click(object sender, RoutedEventArgs e)
 {
     TryCatch.BeginTryCatch(() =>
     {
         var filePath = "";
         var sd       = new SaveFileDialog {
             Filter = "Pdf documents (*.pdf)|*.pdf"
         };
         sd.ShowDialog();
         if (!string.IsNullOrEmpty(sd.FileName))
         {
             filePath = sd.FileName;
         }
         if (!string.IsNullOrEmpty(sd.FileName))
         {
             _iCommandServiceForUI.ExportToPDFCommand(filePath);
         }
     }
                            );
 }
Exemplo n.º 9
0
 private void WindowLoaded(object sender, System.Windows.RoutedEventArgs e)
 {
     TryCatch.BeginTryCatch(() =>
     {
     });
 }
Exemplo n.º 10
0
 private void btnDeleteItem_Click(object sender, RoutedEventArgs e)
 {
     TryCatch.BeginTryCatch(() => _iCommandServiceForUI.DeleteCommand());
 }