private void btnConfirm_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(txtAdvanceToRetailer.Text)) { MessageBox.ShowBox("MessageID370", BMC_Icon.Information); return; } decimal dAdvanceToRetailer = 0.0M; if (!CheckForValidAdvanceToRetailValue(out dAdvanceToRetailer)) { MessageBox.ShowBox("MessageID434", BMC_Icon.Information); return; } System.Windows.Forms.DialogResult dr = MessageBox.ShowBox("MessageID371", BMC_Icon.Question, BMC_Button.YesNo); if (dr.ToString() == "Yes") { //Update advance retailer value UpdateAdvanceRetailer(); //Calculate the retailer negative net CalculateRetailerNegative(); var oReports = new CollectionBatchReports(_BatchNo, this); oReports.ShowDialog(); } }
private async void ButtonSuffixUncertain_OnClick(object sender, RoutedEventArgs e) { System.Windows.Forms.OpenFileDialog OpenDialog = new System.Windows.Forms.OpenFileDialog { Filter = "STAR Files|*.star" }; System.Windows.Forms.DialogResult ResultOpen = OpenDialog.ShowDialog(); if (ResultOpen.ToString() == "OK") { Movie[] Movies = Options.MainWindow.FileDiscoverer.GetImmutableFiles(); bool FoundMatchingSuffix = false; string StarName = Helper.PathToName(OpenDialog.FileName); foreach (var item in Movies) { if (StarName.Contains(item.RootName)) { FoundMatchingSuffix = true; SuffixUncertain = StarName.Substring(item.RootName.Length); FolderUncertain = Helper.PathToFolder(OpenDialog.FileName); ButtonSuffixUncertainText.Text = "*" + SuffixUncertain; ButtonSuffixUncertain.ToolTip = FolderUncertain + "*" + SuffixUncertain; break; } } if (!FoundMatchingSuffix) { await Options.MainWindow.ShowMessageAsync("Oopsie", "STAR file could not be matched to any of the movies to determine the suffix."); return; } } }
private async void ButtonMaskPath_OnClick(object sender, RoutedEventArgs e) { System.Windows.Forms.OpenFileDialog Dialog = new System.Windows.Forms.OpenFileDialog { Filter = "MRC file|*.mrc", Multiselect = false }; System.Windows.Forms.DialogResult Result = Dialog.ShowDialog(); if (Result.ToString() == "OK") { Mask = Image.FromFile(Dialog.FileName); if ((bool)RadioMaskFile.IsChecked && Halfmap1 != null && Halfmap1.Dims != Mask.Dims) { Mask = null; await((MainWindow)Application.Current.MainWindow).ShowMessageAsync("Oopsie", "Mask dimensions don't match half-maps."); return; } PathMask = Dialog.FileName; ButtonMaskPath.Content = Helper.ShortenString(PathMask, 55); UpdateMask(); } }
//path 1 postings files private void browse1_Click(object sender, RoutedEventArgs e) { var dialog = new System.Windows.Forms.FolderBrowserDialog(); System.Windows.Forms.DialogResult result = dialog.ShowDialog(); if (result.ToString() == "Cancel") { return; } path1.Text = dialog.SelectedPath; if (path1.Text != "Postings path") { dataPathOn = true; PostingsPath = dialog.SelectedPath; if (File.Exists(@PostingsPath + @"\TermPostings.txt") || File.Exists(@PostingsPath + @"\TermPostingsStemming.txt")) { ReadTermsPostingsButton.IsEnabled = true; } } if (dataPathOn && postingsPathOn) { Start.IsEnabled = true; } }
private async void ButtonParticlesWarpPath_OnClick(object sender, RoutedEventArgs e) { System.Windows.Forms.OpenFileDialog Dialog = new System.Windows.Forms.OpenFileDialog { Filter = "STAR file|*.star", Multiselect = false }; System.Windows.Forms.DialogResult Result = Dialog.ShowDialog(); if (Result.ToString() == "OK") { TableWarp = new Star(Dialog.FileName); if (!TableWarp.HasColumn("wrpCoordinateX1") || !TableWarp.HasColumn("wrpCoordinateY1") || !TableWarp.HasColumn("wrpAngleRot1") || !TableWarp.HasColumn("wrpAngleTilt1") || !TableWarp.HasColumn("wrpAnglePsi1") || !TableWarp.HasColumn("wrpSourceHash")) { TableWarp = null; await((MainWindow)Application.Current.MainWindow).ShowMessageAsync("Oopsie", "Table does not contain all essential columns (coordinates, angles, source hash)."); return; } PathWarp = Dialog.FileName; ButtonParticlesWarpPath.Content = Helper.ShortenString(PathWarp, 55); UpdateParticles(); } }
private void btnexprt_Click(object sender, RoutedEventArgs e) { //Clearing the frame this.frame.Content = null; //Opening a Dialog for selecting a folder. var dialog = new System.Windows.Forms.FolderBrowserDialog(); System.Windows.Forms.DialogResult result = dialog.ShowDialog(); //if the path is selected and clicking on Ok Button checking this condition. if (result.ToString() == "OK") { Selected_Path = dialog.SelectedPath; PreLoaderPopup.IsOpen = true; DisableButtons(); MyWorker.DoWork += worker_DoWork; MyWorker.RunWorkerCompleted += worker_RunWorkerCompleted; MyWorker.RunWorkerAsync(); } //By Using Multithreading running 2 methods at a time //Task task1 = Task.Factory.StartNew(() => GetData()); //Task task2 = Task.Factory.StartNew(() => openPopup()); //Task.WaitAll(task1, task2); //setting timer for 2 seconds after that calling a method named timer_Tick //timer = new DispatcherTimer(); //timer.Interval = TimeSpan.FromMilliseconds(2000); //timer.Tick += new EventHandler(timer_Tick); //timer.Start(); }
public void StartNewFinancial(object param) { string msg = "Simple will backup your Company file.\n" + "Assets, Liabilities and Capital Accounts: Simple will transfer last year current balances to this year opening balances.Simple will put zeros in this year year-to - date and current balances.\n" + "Income, Costs and Expenses Accounts: Simple will put zeros in this year opening balances, year - to - date and current balances.\n" + "Income, Costs and Expenses Accounts do not have opening balances.\n" + "@ Simple Accounting Software Pte Ltd"; //MessageBoxResult res = System.Windows.MessageBox.Show(msg); //if (res == MessageBoxResult.OK) //{ //} System.Windows.Forms.MessageBoxManager.Yes = "FinancialYear"; System.Windows.Forms.MessageBoxManager.No = "Cancel"; System.Windows.Forms.MessageBoxManager.Register(); System.Windows.Forms.DialogResult result = System.Windows.Forms.MessageBox.Show(msg, "", System.Windows.Forms.MessageBoxButtons.YesNo); if (result == System.Windows.Forms.DialogResult.Yes) { System.Windows.Forms.DialogResult StartResult = System.Windows.Forms.MessageBox.Show("Are you sure you want to Start New Financial Year?\n" + "@ Simple Accounting Software Pte Ltd", "", System.Windows.Forms.MessageBoxButtons.OKCancel); //var x = System.Windows.Forms.MessageBox.Show("Are you sure you want to Start New Financial Year?", "", System.Windows.Forms.MessageBoxButtons.OKCancel); if (StartResult == System.Windows.Forms.DialogResult.OK) { repo.StartNewFinancialYear(StartResult.ToString()); } else { } } else { } System.Windows.Forms.MessageBoxManager.Unregister(); }
private void btnOpenFold_Click(object sender, RoutedEventArgs e) { System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog(); System.Windows.Forms.DialogResult result = fbd.ShowDialog(); if (result.ToString() == "OK") { package = new FontPackage(); switch (package.LoadH2Folder(fbd.SelectedPath)) { case 0: break; case 1: WriteLog("Folder \"\\" + System.IO.Path.GetFileName(inputpkgpath.Text) + "\" contained no valid fonts."); return; } } else { return; } inputpkgpath.Text = fbd.SelectedPath; WriteLog("Folder \"\\" + System.IO.Path.GetFileName(inputpkgpath.Text) + "\" has been loaded successfully with " + package.Fonts.Count + " fonts."); btnSavefile.IsEnabled = true; FinishOpening(); }
private async void ButtonHalfmap1Path_OnClick(object sender, RoutedEventArgs e) { System.Windows.Forms.OpenFileDialog Dialog = new System.Windows.Forms.OpenFileDialog { Filter = "MRC file|*.mrc", Multiselect = false }; System.Windows.Forms.DialogResult Result = Dialog.ShowDialog(); if (Result.ToString() == "OK") { Halfmap1 = Image.FromFile(Dialog.FileName); if ((bool)RadioHalfmap2File.IsChecked && Halfmap2 != null && Halfmap1.Dims != Halfmap2.Dims) { Halfmap1 = null; await((MainWindow)Application.Current.MainWindow).ShowMessageAsync("Oopsie", "Half-map dimensions don't match."); return; } float2 MeanStd = MathHelper.MeanAndStd(Halfmap1.GetHostContinuousCopy()); RendererHalfmap1.Camera.SurfaceThreshold = (decimal)(MeanStd.X + 3 * MeanStd.Y); RendererHalfmap2.Camera.SurfaceThreshold = (decimal)(MeanStd.X + 3 * MeanStd.Y); MaskThreshold = (decimal)(MeanStd.X + 3 * MeanStd.Y); HalfmapPixelSize = (decimal)Halfmap1.PixelSize; PathHalfmap1 = Dialog.FileName; ButtonHalfmap1Path.Content = Helper.ShortenString(PathHalfmap1, 55); UpdateHalfmaps(); } }
private void Button_Click_1(object sender, RoutedEventArgs e) { System.Windows.Forms.SaveFileDialog dialog = new System.Windows.Forms.SaveFileDialog(); dialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);; dialog.DefaultExt = ".zip"; dialog.Filter = "Choose format ||Compressed file (*.rar)|*.rar|Compressed file (*.zip)|*.zip|Compressed file (*.7z)|*.7z"; if (content.Count != 0) { if (content.First().Folder) { dialog.FileName = content.First().Name; } else { string ime = ""; string[] imena = content.First().Name.Split('.'); for (int i = 0; i < imena.Length - 1; i++) { ime += imena[i]; } dialog.FileName = ime; } } System.Windows.Forms.DialogResult result = dialog.ShowDialog(); if (result.ToString() == "OK") { tbcompress.Text = dialog.FileName; } }
private void miEditAddFolder_Click(object sender, RoutedEventArgs e) { string folderpath; System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog(); fbd.SelectedPath = Environment.CurrentDirectory; System.Windows.Forms.DialogResult result = fbd.ShowDialog(); if (result.ToString() == "OK") { folderpath = fbd.SelectedPath; } else { folderpath = ""; } if (folderpath != "") { string[] files = GetFiles(folderpath, "*.jpg;*.jpeg;*.png;", SearchOption.AllDirectories); foreach (string filepath in files) { LoadSprite(filepath); } lbSprites.Items.SortDescriptions.Add(new System.ComponentModel.SortDescription("", System.ComponentModel.ListSortDirection.Ascending)); SortTiles(lSpriteSheet, bSpriteSheet); } }
private async void OnSetCk3Root() { using (var dlg = new System.Windows.Forms.FolderBrowserDialog()) { System.Windows.Forms.DialogResult result = dlg.ShowDialog(); if (result.ToString().Equals("OK")) { string dir = dlg.SelectedPath; string currDir = dir.Substring(dir.LastIndexOf("\\") + 1); if (currDir.Equals("Crusader Kings III")) { coaCompFilesLoader.ck3RootDir = dir; await coaCompFilesLoader.WriteCk3DirToFile(); // FIX THIS TRASH: MAKE BTN DISAPPEAR WHEN DIR HAS BEEN SET CoaCompFilesBtnVisibility = false; InitCoaComponents(); CoaComponentsLoader.ImportCoaComponents(coaCompFilesLoader.ck3RootDir + "\\game\\gfx\\coat_of_arms\\patterns", "./coat_of_arms/patterns", ".dds", ".png"); CoaComponentsLoader.ImportCoaComponents(coaCompFilesLoader.ck3RootDir + "\\game\\gfx\\coat_of_arms\\colored_emblems", "./coat_of_arms/colored_emblems", ".dds", ".png"); OnPropertyChanged("CoaCompFilesBtnVisibility"); OnPropertyChanged("CoaComponents"); System.Windows.MessageBox.Show("CK3 root dir set:\r\n" + coaCompFilesLoader.ck3RootDir); } else { System.Windows.MessageBox.Show("Incorrect Path"); } } dlg.Dispose(); } }
private void ButtonAddFolder_Click(object sender, RoutedEventArgs e) { System.Windows.Forms.DialogResult result = promptForFolder(); if (!result.ToString().Equals("Cancel")) { uploadProject(); dgl.loadProjects(); } }
private void btnSaveSettings_Click(object sender, RoutedEventArgs e) { try { btnSaveSettings.IsEnabled = false; AFTSetting setting = null; lstSetting = new List <AFTSetting>(); ItemContainerGenerator generator = this.lvAFTSettings.ItemContainerGenerator; for (int i = 0; i < lvAFTSettings.Items.Count; i++) { ListViewItem selectedItem = (ListViewItem)generator.ContainerFromIndex(i); CheckBox chkNotify = GetDescendantByType(selectedItem, typeof(CheckBox), "chkActive") as CheckBox; if (chkNotify != null ) { setting = new AFTSetting(); setting.IsActive = (bool)chkNotify.IsChecked; setting.Value = (((bool)chkNotify.IsChecked)) == true ? "1" : "0"; setting.IsCheckBox = true; } else { //Try to find others: TextBox tbFind = GetDescendantByType(selectedItem, typeof(TextBox), "txtActive") as TextBox; if (tbFind != null) { setting = new AFTSetting(); setting.Value = tbFind.Text; setting.IsCheckBox = false; } } setting.Name = ((AFTSetting)selectedItem.Content).Name; lstSetting.Add(setting); } System.Windows.Forms.DialogResult dr = MessageBox.ShowBox("MessageID290", BMC_Icon.Question, BMC_Button.YesNo); if (dr.ToString() == "Yes") { if (objAFTSettings.SaveAFTSettings(lstSetting)) { MessageBox.ShowBox("MessageID291", BMC_Icon.Information, BMC_Button.OK); } else { MessageBox.ShowBox("MessageID292", BMC_Icon.Information, BMC_Button.OK); } } } finally { btnSaveSettings.IsEnabled = true; } }
private void outdirBrowse_Click(object sender, RoutedEventArgs e) { var dialog = new System.Windows.Forms.FolderBrowserDialog(); System.Windows.Forms.DialogResult result = dialog.ShowDialog(); if (result.ToString() == "OK") { outdirLabel.Content = dialog.SelectedPath; } }
private String SpecifyDestPathForBatch() { folderBrowserM.ShowNewFolderButton = true; System.Windows.Forms.DialogResult result = folderBrowserM.ShowDialog(); if (result.ToString() == "OK" && btnGen != null) { txtDestinationForPdfBatch.Text = folderBrowserM.SelectedPath; } return(folderBrowserM.SelectedPath); }
private String SpecifyDestinationPath() { FolderBrowser.ShowNewFolderButton = true; System.Windows.Forms.DialogResult result = FolderBrowser.ShowDialog(); if (result.ToString() == "OK" && btnGenerate != null) { txtDestination.Text = FolderBrowser.SelectedPath; } return(FolderBrowser.SelectedPath); }
private void browseButtonClicked(object sender, RoutedEventArgs e) { var dialog = new System.Windows.Forms.FolderBrowserDialog(); System.Windows.Forms.DialogResult result = dialog.ShowDialog(); if (result.ToString() == "OK") { ardiunoPathTextBox.Text = dialog.SelectedPath + "\\Export"; } }
private void btnExaminarSerializarXML_Click(object sender, RoutedEventArgs e) { var dialog = new System.Windows.Forms.FolderBrowserDialog(); System.Windows.Forms.DialogResult result = dialog.ShowDialog(); if (result.ToString() == "OK") { txtFileSerializarXML.Text = dialog.SelectedPath; } }
private void btn_selectFolder_Click(object sender, RoutedEventArgs e) { System.Windows.Forms.FolderBrowserDialog folderDialog = new System.Windows.Forms.FolderBrowserDialog(); folderDialog.SelectedPath = txt_defaultReportFolder.Text; System.Windows.Forms.DialogResult result = folderDialog.ShowDialog(); if (result.ToString() == "OK") { txt_defaultReportFolder.Text = folderDialog.SelectedPath; } }
private async void ButtonParticlesRelionPath_OnClick(object sender, RoutedEventArgs e) { System.Windows.Forms.OpenFileDialog Dialog = new System.Windows.Forms.OpenFileDialog { Filter = "STAR file|*_data.star", Multiselect = false }; System.Windows.Forms.DialogResult Result = Dialog.ShowDialog(); if (Result.ToString() == "OK") { TableRelion = new Star(Dialog.FileName); if (!TableRelion.HasColumn("rlnCoordinateX") || !TableRelion.HasColumn("rlnCoordinateY") || !TableRelion.HasColumn("rlnAngleRot") || !TableRelion.HasColumn("rlnAngleTilt") || !TableRelion.HasColumn("rlnAnglePsi") || !TableRelion.HasColumn("rlnMicrographName")) { TableRelion = null; await((MainWindow)Application.Current.MainWindow).ShowMessageAsync("Oopsie", "Table does not contain all essential columns (coordinates, angles, micrograph name)."); return; } if (TableRelion.HasColumn("rlnDetectorPixelSize") && TableRelion.HasColumn("rlnMagnification")) { try { decimal DetectorPixel = decimal.Parse(TableRelion.GetRowValue(0, "rlnDetectorPixelSize")) * 1e4M; decimal Mag = decimal.Parse(TableRelion.GetRowValue(0, "rlnMagnification")); PauseParticleUpdates = true; { ParticleCoordinatesPixel = DetectorPixel / Mag; ParticleShiftsPixel = DetectorPixel / Mag; } PauseParticleUpdates = false; } catch { } } int NameIndex = TableRelion.GetColumnID("rlnMicrographName"); for (int r = 0; r < TableRelion.RowCount; r++) { TableRelion.SetRowValue(r, NameIndex, Helper.PathToNameWithExtension(TableRelion.GetRowValue(r, NameIndex))); } PathRelion = Dialog.FileName; ButtonParticlesRelionPath.Content = Helper.ShortenString(PathRelion, 55); UpdateParticles(); } }
private void btnBrowseDir_Click(object sender, RoutedEventArgs e) { using (var dialog = new System.Windows.Forms.FolderBrowserDialog()) { System.Windows.Forms.DialogResult result = dialog.ShowDialog(); if (result.ToString() == "OK") { txtDir.Text = dialog.SelectedPath; } } }
private void browseFolder_Click(object sender, RoutedEventArgs e) { var dialog = new System.Windows.Forms.FolderBrowserDialog(); System.Windows.Forms.DialogResult result = dialog.ShowDialog(); if (result.ToString() != "OK") { return; } baseFolder.Text = dialog.SelectedPath; }
private void Button_Click_2(object sender, RoutedEventArgs e) { System.Windows.Forms.FolderBrowserDialog folderDialog = new System.Windows.Forms.FolderBrowserDialog(); folderDialog.SelectedPath = "C:\\"; System.Windows.Forms.DialogResult result = folderDialog.ShowDialog(); if (result.ToString() == "OK") { tbuncompress.Text = folderDialog.SelectedPath; } }
private void Button_Click(object sender, RoutedEventArgs e) { Settings settings = (Settings)DataContext; System.Windows.Forms.FolderBrowserDialog folderDialog = new System.Windows.Forms.FolderBrowserDialog(); folderDialog.SelectedPath = "C:\\"; System.Windows.Forms.DialogResult result = folderDialog.ShowDialog(); if (result.ToString() == "OK") { settings.TempFolderPath = folderDialog.SelectedPath + '\\'; } }
private void ButtonSimulationOutputDirectory_Clicked(object sender, RoutedEventArgs e) { System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog(); dialog.SelectedPath = "C:\\"; System.Windows.Forms.DialogResult result = dialog.ShowDialog(); if (result.ToString() == "OK") { _outputDirectory = dialog.SelectedPath; LabelSimulationOutputDirectory.Text = dialog.SelectedPath; } }
private void Btn_selectPath_Click(object sender, RoutedEventArgs e) { using (var dialog = new System.Windows.Forms.FolderBrowserDialog()) // открываем диалоговое окно выбора папки анализа { dialog.Description = "Укажите место расположения папки"; System.Windows.Forms.DialogResult result = dialog.ShowDialog(); // получаем имя кнопки, по которой закрыли диалоговое окно if (result.ToString() == "OK") // если ок, то путь выбрали { tb_path.Text = dialog.SelectedPath.ToString(); // кладём в текстбокс путь к выбранной папке } } }
private void fileLocationButton_Click(object sender, RoutedEventArgs e) { using (var dialog = new System.Windows.Forms.FolderBrowserDialog()) { System.Windows.Forms.DialogResult result = dialog.ShowDialog(); var checker = result.ToString(); if (checker == "OK") { thePath = dialog.SelectedPath; fileLocationIsSet?.Invoke(this, ""); } } }
private void btnClose_Click(object sender, RoutedEventArgs e) { System.Windows.Forms.DialogResult result = System.Windows.Forms.MessageBox.Show("退出导航吗?", "", System.Windows.Forms.MessageBoxButtons.OKCancel, System.Windows.Forms.MessageBoxIcon.Question, System.Windows.Forms.MessageBoxDefaultButton.Button2, System.Windows.Forms.MessageBoxOptions.DefaultDesktopOnly); if (result.ToString() == "OK") { this.Close(); System.Windows.Forms.Application.Exit(); } else { return; } }
/// <summary> /// 打开文件对话框 /// </summary> /// <param name="filter">过滤条件</param> /// <returns>返回文件路径</returns> public static string OpenFolderDialog() { System.Windows.Forms.FolderBrowserDialog folder = new System.Windows.Forms.FolderBrowserDialog(); System.Windows.Forms.DialogResult dr = folder.ShowDialog();//打开文件夹会话 if (dr.ToString() == "OK") { return(folder.SelectedPath);//获取文件夹路径 } else { return(""); } }