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


C# Task.ShowDialog方法代码示例

本文整理汇总了C#中Task.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# Task.ShowDialog方法的具体用法?C# Task.ShowDialog怎么用?C# Task.ShowDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Task的用法示例。


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

示例1: button1_Click_1

 private void button1_Click_1(object sender, EventArgs e)
 {
     if (textBox1.Text.Length == 0)
     {
         MessageBox.Show("Error 29486247826412");
         return;
     }
     if (textBox2.Text.Length == 0)
     {
         MessageBox.Show("Error 29486247826413");
         return;
     }
     if (textBox3.Text.Length == 0)
     {
         MessageBox.Show("Error 29486247826414");
         return;
     }
     Task pr = new Task(textBox1.Text, textBox2.Text, textBox3.Text, listBox1.Text, comboBox1.Text, radioButton1.Checked, radioButton2.Checked);
     pr.ShowDialog();
 }
开发者ID:rshagiev,项目名称:Lab1,代码行数:20,代码来源:Form1.cs

示例2: Create

        private void Create(Microsoft.Office.Interop.Outlook.MailItem mailItem)
        {
            String messageClass;
            DevExpress.XtraRichEdit.RichEditControl rtfControl = new DevExpress.XtraRichEdit.RichEditControl();
            TIS.DL.Internal.Task.TaskObject taskObj;
            Microsoft.Office.Interop.Outlook.Inspector inspector;
            try
            {
                messageClass = mailItem.MessageClass;

                if (messageClass == "IPM.Note")
                {
                    taskObj = new TIS.DL.Internal.Task.TaskObject();
                    ProcessEmailAddresses(taskObj, mailItem);
                    //Get Reporter
                    Microsoft.Office.Interop.Outlook.NameSpace outNamespace;
                    outNamespace = Application.GetNamespace("MAPI");
                    Microsoft.Office.Interop.Outlook.Recipient reporter = outNamespace.CurrentUser;
                    ProcessEmailAddressReporter(taskObj, reporter.Address);

                    taskObj.CreationDate = PROF_IT.Common.Convert.DateFunctions.DateToStrDate(System.DateTime.Now);
                    //RTF BODY
                    inspector = mailItem.GetInspector;
                    inspector.Activate();
                    Microsoft.Office.Interop.Word.Document document = (Microsoft.Office.Interop.Word.Document)inspector.WordEditor;
                    document.Select();
                    document.Application.Selection.Copy();
                    rtfControl.Paste();
                    taskObj.Description = rtfControl.RtfText;

                    //Subject
                    taskObj.Tag = mailItem.Subject;
                    switch (mailItem.Importance)
                    {
                        case Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh:
                            taskObj.Priority = TIS.Framework.Common.Enumeration.Task.Priority.High;
                            break;
                        case Microsoft.Office.Interop.Outlook.OlImportance.olImportanceLow:
                            taskObj.Priority = TIS.Framework.Common.Enumeration.Task.Priority.Low;
                            break;
                        case Microsoft.Office.Interop.Outlook.OlImportance.olImportanceNormal:
                            taskObj.Priority = TIS.Framework.Common.Enumeration.Task.Priority.Medium;
                            break;
                    }
                    taskObj.Effort = TIS.Framework.Common.Enumeration.Task.Effort.Low;
                    taskObj.Status = TIS.Framework.Common.Enumeration.Task.Status.Open;

                    Task task = new Task(PROF_IT.Common.Enumerations.TypeForm.PropertyForm, taskObj);
                    task.ShowDialog();

                    //Close document, inspector
                    if (inspector != null) inspector.Close(Microsoft.Office.Interop.Outlook.OlInspectorClose.olDiscard);
                    document = null;
                    inspector = null;
                    mailItem = null;
                }
                else
                {
                    MessageBox.Show("Kan geen task creëren omdat het geselecteerde item geen e-mail is!");
                }
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            finally
            {

                rtfControl.Dispose();
            }
        }
开发者ID:GianiWVL,项目名称:VUYLSTEKE,代码行数:72,代码来源:CreateTask.cs


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