コード例 #1
0
        //--------------------------------------------------------------------------------------------------

        public static bool RecentFileNotFound(string filePath)
        {
            return(TaskDialog.ShowMessage(Application.Current.MainWindow,
                                          $"Recent file {Path.GetFileName(filePath)} not found.",
                                          $"The selected file {filePath} does no longer exist. Should it be removed from the recent file list?",
                                          "Recent file not found",
                                          TaskDialogCommonButtons.YesNo, TaskDialogIcon.Error) == TaskDialogResults.Yes);
        }
コード例 #2
0
ファイル: ErrorDialogs.cs プロジェクト: Macad3D/Macad3D
        //--------------------------------------------------------------------------------------------------

        public static void CannotLoadImage(string filePath)
        {
            TaskDialog.ShowMessage(Application.Current?.MainWindow,
                                   $"Loading image from file {Path.GetFileName(filePath)} failed.",
                                   $"The file {filePath} does not contain valid image data or the image format is not supported.",
                                   "Image loading failed",
                                   TaskDialogCommonButtons.Close, TaskDialogIcon.Error);
        }
コード例 #3
0
ファイル: Dialogs.cs プロジェクト: Macad3D/Macad3D
        //--------------------------------------------------------------------------------------------------

        public static TaskDialogResults AskForSavingModelChanges()
        {
            return(TaskDialog.ShowMessage(Application.Current.MainWindow,
                                          "Save current model?",
                                          "The current model has unsaved changes, which will be discarded. Do you want to save the changes before proceeding?",
                                          "Unsaved Changes",
                                          TaskDialogCommonButtons.YesNoCancel, TaskDialogIcon.Warning));
        }
コード例 #4
0
ファイル: Dialogs.cs プロジェクト: Macad3D/Macad3D
        //--------------------------------------------------------------------------------------------------

        public static bool AssureComponentDeletion(string componentName)
        {
            return(TaskDialog.ShowMessage(Application.Current.MainWindow,
                                          $"Remove {componentName} component?",
                                          $"Do you really want to remove the {componentName} component from this entity?",
                                          "Remove Component",
                                          TaskDialogCommonButtons.OKCancel, TaskDialogIcon.Warning) == TaskDialogResults.Ok);
        }
コード例 #5
0
        //--------------------------------------------------------------------------------------------------

        public static void CannotMove(string name, string message)
        {
            TaskDialog.ShowMessage(Application.Current.MainWindow,
                                   $"Moving asset {Path.GetFileName(name)} failed.",
                                   message,
                                   "Asset moving failed",
                                   TaskDialogCommonButtons.Close, TaskDialogIcon.Error);
        }
コード例 #6
0
ファイル: Dialogs.cs プロジェクト: Macad3D/Macad3D
        //--------------------------------------------------------------------------------------------------

        public static bool UseAspectRatioFromImageFile()
        {
            return(TaskDialog.ShowMessage(Application.Current.MainWindow,
                                          $"Use Aspect Ratio from image?",
                                          $"The loaded image file has a different aspect ratio than the plane it will be assigned to. Should the Y-dimension of the plane adjusted to match the aspect ratio of the image?",
                                          $"Aspect Ratio",
                                          TaskDialogCommonButtons.YesNo, TaskDialogIcon.Question) == TaskDialogResults.Yes);
        }
コード例 #7
0
        //--------------------------------------------------------------------------------------------------

        public static void FileLoadedWithErrors(string filePath)
        {
            TaskDialog.ShowMessage(Application.Current.MainWindow,
                                   $"File {Path.GetFileName(filePath)} loaded with errors.",
                                   $"The selected file {filePath} has been loaded, but errors occured. See log for details. It is recommended to check the content and save to a new file.",
                                   "File loading",
                                   TaskDialogCommonButtons.Close, TaskDialogIcon.Warning);
        }
コード例 #8
0
 public static void PathNotRelativeToProject()
 {
     TaskDialog.ShowMessage(Application.Current.MainWindow,
                            "Path not in project directory.",
                            "The selected path is not part of the project directory or any subdirectory of the project directory. This is needed for correct reference.",
                            "Path not valid",
                            TaskDialogCommonButtons.Close, TaskDialogIcon.Error);
 }
コード例 #9
0
ファイル: Dialogs.cs プロジェクト: Macad3D/Macad3D
 public static TaskDialogResults AskForSavingChanges()
 {
     return(TaskDialog.ShowMessage(Application.Current.MainWindow,
                                   "Save changes?",
                                   "There are unsaved changes left. Do you want to save them before exit?",
                                   "Unsaved Changes",
                                   TaskDialogCommonButtons.YesNoCancel, TaskDialogIcon.Warning));
 }
コード例 #10
0
        //--------------------------------------------------------------------------------------------------

        public static void CannotLoadFile(string filePath)
        {
            TaskDialog.ShowMessage(Application.Current.MainWindow,
                                   $"Loading file {Path.GetFileName(filePath)} failed.",
                                   $"The selected file {filePath} could not be loaded. This maybe because it is not found or has an invalid format.",
                                   "File loading failed",
                                   TaskDialogCommonButtons.Close, TaskDialogIcon.Error);
        }
コード例 #11
0
        //--------------------------------------------------------------------------------------------------

        public static void FileVersionIsNewer(string filePath)
        {
            TaskDialog.ShowMessage(Application.Current.MainWindow,
                                   $"File format of {Path.GetFileName(filePath)} is newer.",
                                   $"The selected file {filePath} was saved in a newer file format version, and can not safely be loaded. Please consider updating the program version.",
                                   "File loading failed",
                                   TaskDialogCommonButtons.Close, TaskDialogIcon.Error);
        }
コード例 #12
0
        //--------------------------------------------------------------------------------------------------

        public static void CannotImportFromClipboard()
        {
            TaskDialog.ShowMessage(Application.Current.MainWindow,
                                   $"Import from clipboard failed.",
                                   $"The import from clipboard has failed. This maybe because the import format does not support this or the importer itself throwed an error. Please check log for details.",
                                   "Import failed",
                                   TaskDialogCommonButtons.Close, TaskDialogIcon.Error);
        }
コード例 #13
0
        //--------------------------------------------------------------------------------------------------

        public static void CannotImport(string filePath)
        {
            TaskDialog.ShowMessage(Application.Current.MainWindow,
                                   $"Import of file {Path.GetFileName(filePath)} failed.",
                                   $"The import from {filePath} has failed. This maybe because the path does not exists or the importer itself throwed an error. Please check log for details.",
                                   "Import failed",
                                   TaskDialogCommonButtons.Close, TaskDialogIcon.Error);
        }
コード例 #14
0
        //--------------------------------------------------------------------------------------------------

        public static void CannotRunScript(string scriptname)
        {
            TaskDialog.ShowMessage(Application.Current.MainWindow,
                                   $"Running script {Path.GetFileName(scriptname)} failed.",
                                   $"The script {scriptname} cannot be compiled or failed to run. Please check log for details.",
                                   "Run script failed",
                                   TaskDialogCommonButtons.Close, TaskDialogIcon.Error);
        }
コード例 #15
0
        //--------------------------------------------------------------------------------------------------

        public static void CannotSaveFile(string filePath)
        {
            TaskDialog.ShowMessage(Application.Current.MainWindow,
                                   $"Saving file {Path.GetFileName(filePath)} failed.",
                                   $"The selected file {filePath} could not be saved. This maybe because it is read-only or the path does not exists.",
                                   "File saving failed",
                                   TaskDialogCommonButtons.Close, TaskDialogIcon.Error);
        }
コード例 #16
0
ファイル: Dialogs.cs プロジェクト: Macad3D/Macad3D
        //--------------------------------------------------------------------------------------------------

        public static bool AssureAssetDeletion(bool multiple)
        {
            var s = multiple ? "s" : "";

            return(TaskDialog.ShowMessage(Application.Current.MainWindow,
                                          $"Permamently delete asset{s}?",
                                          $"The file{s} of the selected asset{s} will be deleted permamently. This action cannot be reverted. The asset file is moved to the recycle bin of your drive, if enabled.",
                                          $"Delete Asset{s}",
                                          TaskDialogCommonButtons.OKCancel, TaskDialogIcon.Warning) == TaskDialogResults.Ok);
        }
コード例 #17
0
ファイル: Dialogs.cs プロジェクト: Macad3D/Macad3D
        //--------------------------------------------------------------------------------------------------

        public static bool AssureLayerDeletion(bool multiple, string names)
        {
            var s = multiple ? "s" : "";

            return(TaskDialog.ShowMessage(Application.Current.MainWindow,
                                          $"Delete selected layer{s}?",
                                          $"The layer{s} '{names}' will be deleted permamently. This action cannot be reverted. All entities assigned to this layer will be reassigned to the default layer.",
                                          $"Delete Layer{s}",
                                          TaskDialogCommonButtons.OKCancel, TaskDialogIcon.Warning) == TaskDialogResults.Ok);
        }
コード例 #18
0
        private void button3_Click(object sender, RoutedEventArgs e)
        {
            TaskDialogSimpleResult res =
                TaskDialog.ShowMessage(
                    this,
                    "WARNING: Formatting will erase ALL data on this disk. To format the disk, click OK. To quit, click Cancel.",
                    "Format Local Disk (F:)",
                    TaskDialogCommonButtons.OKCancel,
                    VistaTaskDialogIcon.Warning);

            UpdateResult(res);
        }
コード例 #19
0
        private void button2_Click(object sender, RoutedEventArgs e)
        {
            TaskDialogSimpleResult res =
                TaskDialog.ShowMessage(this,
                                       "Outlook",
                                       "ActiveSync can't log on to Outlook",
                                       "Make sure that Outlook is installed and functioning correctly.",
                                       "You may need to restart your computer. You could have a conflict due to two folders on this computer are name C:\\Program Files\\Microsoft and C:\\Program Files\\Microsoft Office. If so, rename the C:\\Program Files\\Microsoft folder so that it does not contain the word \"Microsoft.\" If this folder contains subfolders, you may need to reinstall programs in the renamed folder.\n\nFor more information on renaming folders and installing programs, see Help for your operating system.",
                                       null,
                                       null,
                                       TaskDialogCommonButtons.Close,
                                       VistaTaskDialogIcon.Error,
                                       VistaTaskDialogIcon.None);

            UpdateResult(res);
        }
コード例 #20
0
ファイル: Form1.cs プロジェクト: CIFLWebGuy/Windows
        private void button2_Click(object sender, EventArgs e)
        {
            TaskDialogResults result = TaskDialog.ShowMessage(this.Handle, "Test message", "This is a Task Dialog.", "Hello world!", TaskDialogButtons.Yes | TaskDialogButtons.No, TaskDialogIcons.Warning);

            labelTdResult.Text = string.Format("Task Dialog Result: {0:G}", result);
        }
コード例 #21
0
 public void Show(Window owner, string message)
 {
     TaskDialog.ShowMessage(owner, message);
 }