private void InitializeDataBindings()
        {
            TextBoxFilePath.DataBindings.Clear();
            TextBoxFileName.DataBindings.Clear();
            TextBoxMimeType.DataBindings.Clear();
            AttachmentTypeComboBox.DataBindings.Clear();

            if (_attachment == null)
            {
                return;
            }

            TextBoxFilePath.SetTextDataBinding(_attachment, nameof(_attachment.FilePath));
            TextBoxFileName.SetTextDataBinding(_attachment, nameof(_attachment.Name));
            TextBoxMimeType.SetTextDataBinding(_attachment, nameof(_attachment.Mimetype));
            AttachmentTypeComboBox.SetSelectedItemDataBinding(_attachment, nameof(_attachment.AttachmentType));
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            String filename = TextBoxFileName.Text;
            String path     = Properties.Settings.Default.SearchPath + filename + ".PDF";

            if (filename.Equals(""))
            {
                MessageBox.Show("Ingresa nombre de archivo");
                TextBoxFileName.Focus();
                return;
            }
            if (!System.IO.File.Exists(path))
            {
                MessageBox.Show("No existe el archivo " + path);
                return;
            }



            ProcessStartInfo processStartInfo = new ProcessStartInfo();

            processStartInfo.FileName        = Properties.Settings.Default.BatFilePath;
            processStartInfo.CreateNoWindow  = true;
            processStartInfo.UseShellExecute = false;
            processStartInfo.Arguments       = "\"" + path + "\"";

            Process.Start(processStartInfo);

            //WindowShowDocument winShowDoc = new WindowShowDocument();


            //winShowDoc.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            //winShowDoc.Height = System.Windows.SystemParameters.WorkArea.Height - 50;
            //winShowDoc.Width = System.Windows.SystemParameters.WorkArea.Width - 50;

            //winShowDoc.WebBrowserShowDocument.Navigate(path);
            //winShowDoc.Show();
        }
        private void LoadExternalApplications()
        {
            DgvApplications.Rows.Clear();

            TextBoxFileName.Clear();
            TextBoxFileLocation.Clear();

            foreach (var application in MainWindow.Settings.ExternalApplications)
            {
                _ = DgvApplications.Rows.Add(application.Name, application.FileLocation);
            }

            LabelTotalApplications.Text = $@"{DgvApplications.Rows.Count} Applications";

            ToolStripDeleteAll.Enabled = DgvApplications.Rows.Count > 0;

            DgvApplications.Sort(DgvApplications.Columns[0], ListSortDirection.Ascending);

            if (DgvApplications.Rows.Count > 0)
            {
                DgvApplications.CurrentCell = DgvApplications[0, 0];
            }
        }
 public MainWindow()
 {
     InitializeComponent();
     TextBoxFileName.Focus();
 }
Example #5
0
 private void ButtonNewApplication_Click(object sender, EventArgs e)
 {
     TextBoxFileName.Text     = "";
     TextBoxFileLocation.Text = "";
     _ = TextBoxFileName.Focus();
 }