/// <summary> /// Check if the proposed classification file exists and /// if so, provide a dialog to tell the user /// </summary> /// <returns> /// true if the proposed classification file DOES NOT exist<br/> /// false if the proposed classification file DOES exist /// </returns> /// <param name="fp">The FilePath for the proposed classification file</param> /// <param name="test"></param> /// <param name="title">The error dialog box's title</param> /// <param name="msg"></param> /// <returns></returns> public static bool ValidateProposedClassfFile(FilePath <FileNameUserAndId> fp, bool test, string title, string msg) { if (fp.IsFound == test) { return(true); } CommonTaskDialogs.CommonErrorDialog(title, "The classification file already exists", "The classification File Id provided: \""); // TaskDialog td = new TaskDialog(); // td.Caption = title; // td.Text = "The classification File Id provided: \"" // //+ fileId + // + fp.FileNameObject.FileId + // "\" " // + msg // + ". Please provide a different File Id"; // td.InstructionText = "The classification file already exists"; // td.Icon = TaskDialogStandardIcon.Error; // td.Cancelable = false; // td.OwnerWindowHandle = ScreenParameters.GetWindowHandle(Common.GetCurrentWindow()); // td.StartupLocation = TaskDialogStartupLocation.CenterOwner; // td.Opened += Common.TaskDialog_Opened; // td.Show(); return(false); }
private static void DialogInvalidSampleFile(string fileName) { CommonTaskDialogs.CommonErrorDialog( "Invalid Sample File", "Invalid Sample File", "The Sample File selected \"" + (fileName ?? "(unknown)") + "\" " + "Cannot be used as it is the wrong file type. Please select a file of type \"" + FilePathConstants.SAMPLE_FILE_EXT); // TaskDialog td = new TaskDialog(); // td.Caption = "Invalid Sample File"; // td.InstructionText = "Invalid Sample File"; // td.Icon = TaskDialogStandardIcon.Error; // td.Text = "The Sample File selected \"" + (fileName ?? "(unknown)") + "\" " + // "Cannot be used as it is the wrong file type. Please select a file of type \"" // + FilePathConstants.SAMPLE_FILE_EXT; // td.Cancelable = false; // td.OwnerWindowHandle = ScreenParameters.GetWindowHandle(Common.GetCurrentWindow()); // td.StartupLocation = TaskDialogStartupLocation.CenterOwner; // td.Opened += Common.TaskDialog_Opened; // td.Show(); }