当前位置: 首页>>代码示例>>C#>>正文


C# TaskDialog类代码示例

本文整理汇总了C#中TaskDialog的典型用法代码示例。如果您正苦于以下问题:C# TaskDialog类的具体用法?C# TaskDialog怎么用?C# TaskDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TaskDialog类属于命名空间,在下文中一共展示了TaskDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnClosing

        protected override void OnClosing(CancelEventArgs e)
        {
            var rMode = Preference.Instance.UI.CloseConfirmationMode.Value;
            if (rMode == ConfirmationMode.Always || (rMode == ConfirmationMode.DuringSortie && KanColleGame.Current.Sortie is SortieInfo))
            {
                var rDialog = new TaskDialog()
                {
                    Caption = StringResources.Instance.Main.Product_Name,
                    Instruction = StringResources.Instance.Main.Window_ClosingConfirmation_Instruction,
                    Icon = TaskDialogIcon.Information,
                    Buttons =
                    {
                        new TaskDialogCommandLink(TaskDialogCommonButton.Yes, StringResources.Instance.Main.Window_ClosingConfirmation_Button_Yes),
                        new TaskDialogCommandLink(TaskDialogCommonButton.No, StringResources.Instance.Main.Window_ClosingConfirmation_Button_No),
                    },
                    DefaultCommonButton = TaskDialogCommonButton.No,

                    OwnerWindow = this,
                    ShowAtTheCenterOfOwner = true,
                };
                if (rDialog.ShowAndDispose().ClickedCommonButton == TaskDialogCommonButton.No)
                {
                    e.Cancel = true;
                    return;
                }
            }

            base.OnClosing(e);
        }
开发者ID:amatukaze,项目名称:IntelligentNavalGun,代码行数:29,代码来源:MainWindow.xaml.cs

示例2: Execute

 public Result Execute( Autodesk.Revit.UI.ExternalCommandData cmdData, ref string msg, ElementSet elems )
 {
   TaskDialog helloDlg = new TaskDialog( "Autodesk Revit" );
   helloDlg.MainContent = "Hello World from " + System.Reflection.Assembly.GetExecutingAssembly().Location;
   helloDlg.Show();
   return Result.Cancelled;
 }
开发者ID:15921050052,项目名称:RevitLookup,代码行数:7,代码来源:TestCmds.cs

示例3: WarnAboutPythonSymbols

        private void WarnAboutPythonSymbols(string moduleName) {
            const string content =
                "Python/native mixed-mode debugging requires symbol files for the Python interpreter that is being debugged. Please add the folder " +
                "containing those symbol files to your symbol search path, and force a reload of symbols for {0}.";

            var dialog = new TaskDialog(_serviceProvider);

            var openSymbolSettings = new TaskDialogButton("Open symbol settings dialog");
            var downloadSymbols = new TaskDialogButton("Download symbols for my interpreter");
            dialog.Buttons.Add(openSymbolSettings);
            dialog.Buttons.Add(downloadSymbols);

            dialog.Buttons.Add(TaskDialogButton.Close);
            dialog.UseCommandLinks = true;
            dialog.Title = "Python Symbols Required";
            dialog.Content = string.Format(content, moduleName);
            dialog.Width = 0;

            dialog.ShowModal();

            if (dialog.SelectedButton == openSymbolSettings) {
                var cmdId = new CommandID(VSConstants.GUID_VSStandardCommandSet97, VSConstants.cmdidToolsOptions);
                _serviceProvider.GlobalInvoke(cmdId,  "1F5E080F-CBD2-459C-8267-39fd83032166");
            } else if (dialog.SelectedButton == downloadSymbols) {
                PythonToolsPackage.OpenWebBrowser(
                    string.Format("http://go.microsoft.com/fwlink/?LinkId=308954&clcid=0x{0:X}", CultureInfo.CurrentCulture.LCID));
            }
        }
开发者ID:zooba,项目名称:PTVS,代码行数:28,代码来源:CustomDebuggerEventHandler.cs

示例4: ShowTaskDialog

 private void ShowTaskDialog()
 {
     if( TaskDialog.OSSupportsTaskDialogs )
     {
         using( TaskDialog dialog = new TaskDialog() )
         {
             dialog.WindowTitle = "Task dialog sample";
             dialog.MainInstruction = "This is an example task dialog.";
             dialog.Content = "Task dialogs are a more flexible type of message box. Among other things, task dialogs support custom buttons, command links, scroll bars, expandable sections, radio buttons, a check box (useful for e.g. \"don't show this again\"), custom icons, and a footer. Some of those things are demonstrated here.";
             dialog.ExpandedInformation = "Ookii.org's Task Dialog doesn't just provide a wrapper for the native Task Dialog API; it is designed to provide a programming interface that is natural to .Net developers.";
             dialog.Footer = "Task Dialogs support footers and can even include <a href=\"http://www.ookii.org\">hyperlinks</a>.";
             dialog.FooterIcon = TaskDialogIcon.Information;
             dialog.EnableHyperlinks = true;
             TaskDialogButton customButton = new TaskDialogButton("A custom button");
             TaskDialogButton okButton = new TaskDialogButton(ButtonType.Ok);
             TaskDialogButton cancelButton = new TaskDialogButton(ButtonType.Cancel);
             dialog.Buttons.Add(customButton);
             dialog.Buttons.Add(okButton);
             dialog.Buttons.Add(cancelButton);
             dialog.HyperlinkClicked += new EventHandler<HyperlinkClickedEventArgs>(TaskDialog_HyperLinkClicked);
             TaskDialogButton button = dialog.ShowDialog(this);
             if( button == customButton )
                 MessageBox.Show(this, "You clicked the custom button", "Task Dialog Sample");
             else if( button == okButton )
                 MessageBox.Show(this, "You clicked the OK button.", "Task Dialog Sample");
         }
     }
     else
     {
         MessageBox.Show(this, "This operating system does not support task dialogs.", "Task Dialog Sample");
     }
 }
开发者ID:RogovaTatiana,项目名称:FilesSync,代码行数:32,代码来源:MainWindow.xaml.cs

示例5: Export

        /// <summary>
        /// export to a HTML page that contains the PanelScheduleView instance data.
        /// </summary>
        /// <returns>the exported file path</returns>
        public override string Export()
        {
            string asemblyName = System.Reflection.Assembly.GetExecutingAssembly().Location;
            string tempFile = asemblyName.Replace("PanelSchedule.dll", "template.html");

            if (!System.IO.File.Exists(tempFile))
            {
                TaskDialog messageDlg = new TaskDialog("Warnning Message");
                messageDlg.MainIcon = TaskDialogIcon.TaskDialogIconWarning;
                messageDlg.MainContent = "Can not find 'template.html', please make sure the 'template.html' file is in the same folder as the external command assembly.";
                messageDlg.Show();
                return null;
            }
            

            string panelScheduleFile = asemblyName.Replace("PanelSchedule.dll", ReplaceIllegalCharacters(m_psView.Name) + ".html");

            XmlDocument doc = new XmlDocument();
            XmlTextWriter tw = new XmlTextWriter(panelScheduleFile, null);
            doc.Load(tempFile);

            XmlNode psTable = doc.DocumentElement.SelectSingleNode("//div/table[1]");
            DumpPanelScheduleData(psTable, doc);
            
            doc.Save(tw);

            return panelScheduleFile;
        }
开发者ID:jamiefarrell,项目名称:Panel-Schedules-to-Excel,代码行数:32,代码来源:HTMLTranslator.cs

示例6: Confirm

 public override IDisposable Confirm(ConfirmConfig config)
 {
     var dlg = new TaskDialog
     {
         WindowTitle = config.Title,
         Content = config.Message,
         Buttons =
         {
             new TaskDialogButton(config.CancelText)
             {
                 ButtonType = ButtonType.Cancel
             },
             new TaskDialogButton(config.OkText)
             {
                 ButtonType = ButtonType.Ok
             }
         }
     };
     dlg.ButtonClicked += (sender, args) =>
     {
         var ok = ((TaskDialogButton)args.Item).ButtonType == ButtonType.Ok;
         config.OnAction(ok);
     };
     return new DisposableAction(dlg.Dispose);
 }
开发者ID:philippd,项目名称:userdialogs,代码行数:25,代码来源:UserDialogsImpl.cs

示例7: AskToCreateFolder

        /// <summary>
        /// Shows a dialog asking the user whether she want to create the
        /// specified folder.
        /// </summary>
        /// <param name="path">The folder path.</param>
        /// <returns>
        /// 	<c>true</c> is user wants to create folder; otherwise <c>false</c>.
        /// </returns>
        public bool AskToCreateFolder(string path)
        {
            const string createButtonName = "create";
            const string cancelButtonName = "cancel";

            TaskDialog dialog = new TaskDialog
            {
                Caption = "Create folder?",
                Instruction = "Create folder?",
                Content = "The folder \"" + path + "\" does not exist.",
                MainIcon = TaskDialogStandardIcon.Warning,
                Controls =
                {
                    new TaskDialogCommandLink
                    {
                        Text = "Create Folder",
                        Instruction = "This will create the folder for you and start the image resizing.",
                        Name = createButtonName
                    },
                    new TaskDialogCommandLink
                    {
                        Text = "Cancel",
                        Instruction = "This will cancel the operation and let you choose another output folder.",
                        Name = cancelButtonName
                    }
                }
            };

            TaskDialogResult result = dialog.Show();
            return result.CustomButtonClicked == createButtonName;
        }
开发者ID:tormodfj,项目名称:thumbler,代码行数:39,代码来源:VistaDialogProvider.cs

示例8: AppDialogShowing

        public void AppDialogShowing(object sender, Autodesk.Revit.UI.Events.DialogBoxShowingEventArgs arg)
        {
            //get the help id of the showing dialog
            int dialogId = arg.HelpId;

            //Format the prompt information string
            string promptInfo = "lalala";
            promptInfo += "HelpId : " + dialogId.ToString();

            //Show the prompt information and allow the user close the dialog directly
            TaskDialog td = new TaskDialog("taskDialog1");
            td.MainContent = promptInfo;
            TaskDialogCommonButtons buttons = TaskDialogCommonButtons.Ok| TaskDialogCommonButtons.Cancel;
            td.CommonButtons = buttons;
            //??liuzbkuv mjhglku
            TaskDialogResult tdr = td.Show();
            if (TaskDialogResult.Cancel == tdr)
            {
                //Do not show the Revit dialog
                arg.OverrideResult(1);
            }
            else
            {
                //Continue to show the Revit dialog
                arg.OverrideResult(0);
            }
        }
开发者ID:DanqingYANG,项目名称:RevitLab,代码行数:27,代码来源:Application_DialogShowing.cs

示例9: Execute

        public Result Execute(
            ExternalCommandData commandData,
            ref string message,
            ElementSet elements)
        {
            var dialog = new TaskDialog( "Create DirectShape" )
              {
            MainInstruction = "Select the way you want to create shape"
              };

              dialog.AddCommandLink( TaskDialogCommandLinkId.CommandLink1, "Initial shape builder" );
              dialog.AddCommandLink( TaskDialogCommandLinkId.CommandLink2, "Jeremy's shape builder" );
              dialog.AddCommandLink( TaskDialogCommandLinkId.CommandLink3, "Simple shape builder" );

              switch( dialog.Show() )
              {
            case TaskDialogResult.CommandLink1:
              CreateDirectShapeInitial.Execute1( commandData );
              break;

            case TaskDialogResult.CommandLink2:
              CreateDirectShape.Execute( commandData );
              break;

            case TaskDialogResult.CommandLink3:
              CreateDirectShapeSimple.Execute( commandData );
              break;
              }
              return Result.Succeeded;
        }
开发者ID:jeremytammik,项目名称:DirectShapeFromFace,代码行数:30,代码来源:Command.cs

示例10: EnablePortCustomization_Checked

        void EnablePortCustomization_Checked(object sender, RoutedEventArgs e)
        {
            if (!EnablePortCustomization.IsChecked.Value)
                return;

            var rDialog = new TaskDialog()
            {
                Caption = StringResources.Instance.Main.Product_Name,
                Instruction = StringResources.Instance.Main.PreferenceWindow_Network_Port_Customization_Dialog_Instruction,
                Icon = TaskDialogIcon.Information,
                Content = StringResources.Instance.Main.PreferenceWindow_Network_Port_Customization_Dialog_Content,
                Buttons =
                {
                    new TaskDialogButton(TaskDialogCommonButton.Yes, StringResources.Instance.Main.PreferenceWindow_Network_Port_Customization_Dialog_Button_Yes),
                    new TaskDialogButton(TaskDialogCommonButton.No, StringResources.Instance.Main.PreferenceWindow_Network_Port_Customization_Dialog_Button_No),
                },
                DefaultCommonButton = TaskDialogCommonButton.No,

                OwnerWindow = WindowUtil.GetTopWindow(),
                ShowAtTheCenterOfOwner = true,
            };

            if (rDialog.Show().ClickedCommonButton == TaskDialogCommonButton.No)
                EnablePortCustomization.IsChecked = false;
        }
开发者ID:amatukaze,项目名称:IntelligentNavalGun,代码行数:25,代码来源:Network.xaml.cs

示例11: ErrorMsg

 /// <summary>
 /// Display an error message.
 /// </summary>
 public static void ErrorMsg( string msg )
 {
     Util.Log( msg );
       TaskDialog dlg = new TaskDialog( App.Caption );
       dlg.MainIcon = TaskDialogIcon.TaskDialogIconWarning;
       dlg.MainInstruction = msg;
       dlg.Show();
 }
开发者ID:jeremytammik,项目名称:FireRatingCloud,代码行数:11,代码来源:Util.cs

示例12: Execute

 public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData,
     ref string message, Autodesk.Revit.DB.ElementSet elements)
 {
     TaskDialog dlg = new TaskDialog(@"Hello Revit");
     dlg.MainContent = @"Hello Revit";
     dlg.MainInstruction = @"Say hello!";
     dlg.AddCommandLink(TaskDialogCommandLinkId.CommandLink1, @"Hello");
     dlg.Show();
     return Autodesk.Revit.UI.Result.Succeeded;
 }
开发者ID:tilopfliegner,项目名称:revit,代码行数:10,代码来源:Class1.cs

示例13: ShowTaskDetails

		protected void ShowTaskDetails (TaskItem taskItem)
		{
			currentTaskItem = taskItem;
			taskItemDialog = new TaskDialog (taskItem);
			
			var title = Foundation.NSBundle.MainBundle.LocalizedString ("Task Details", "Task Details");
			context = new LocalizableBindingContext (this, taskItemDialog, title);
			detailsScreen = new DialogViewController (context.Root, true);
			ActivateController(detailsScreen);
		}
开发者ID:jefferywunady,项目名称:mobile-samples,代码行数:10,代码来源:controller_iPhone.cs

示例14: ShowTaskDetails

        protected void ShowTaskDetails(Task task)
        {
            currentTask = task;
            taskDialog = new TaskDialog(task);

            string title = NSBundle.MainBundle.LocalizedString("Task Details", "Task Details");
            context = new LocalizableBindingContext(this, taskDialog, title);
            detailsScreen = new DialogViewController(context.Root, true);
            ActivateController(detailsScreen);
        }
开发者ID:Adameg,项目名称:mobile-samples,代码行数:10,代码来源:HomeScreen.cs

示例15: ErrorMsg

        /// <summary>
        /// MessageBox wrapper for error message.
        /// </summary>
        public static void ErrorMsg( string msg )
        {
            Debug.WriteLine( msg );

              //WinForms.MessageBox.Show( msg, Caption, WinForms.MessageBoxButtons.OK, WinForms.MessageBoxIcon.Error );

              TaskDialog d = new TaskDialog( Caption );
              d.MainIcon = TaskDialogIcon.TaskDialogIconWarning;
              d.MainInstruction = msg;
              d.Show();
        }
开发者ID:jeremytammik,项目名称:BipChecker,代码行数:14,代码来源:Util.cs


注:本文中的TaskDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。