MabiPacker.Dialogs.Error C# (CSharp) Method

Error() public method

public Error ( Exception e, string TaskName ) : void
e System.Exception
TaskName string
return void
        public void Error(Exception e, string TaskName)
        {
            // Error dialog
            TaskDialog tdError = new TaskDialog();
            TaskDialogStandardButtons button = TaskDialogStandardButtons.Ok;
            tdError.StandardButtons = button;
            tdError.DetailsExpanded = false;
            tdError.Cancelable = true;
            tdError.Icon = TaskDialogStandardIcon.Error;

            tdError.Caption = TaskName;
            tdError.InstructionText = Properties.Resources.ErrorMsg;
            tdError.DetailsExpandedText = e.ToString();

            tdError.ExpansionMode = TaskDialogExpandedDetailsLocation.ExpandFooter;

            TaskDialogResult res = tdError.Show();
        }

Usage Example

Esempio n. 1
0
 private void PackBrowser_Shown(object sender, EventArgs e)
 {
     m_Tree.Enabled = false;
     // Insert File tree
     try
     {
         m_Pack = PackResourceSet.CreateFromFile(PackFile);
         if (m_Pack != null)
         {
             Status.Text = Properties.Resources.Str_Initialize;
             this.Text   = this.PackFile + " - MabiPacker";
             uint files = m_Pack.GetFileCount();
             this.pd.Maximum   = files;
             this.pd.Caption   = Properties.Resources.Str_Loading;
             this.pd.Animation = 151;
             this.Update();
             m_Tree.BeginUpdate();
             m_Tree.Nodes.Clear();
             m_Root = m_Tree.Nodes.Add("data", "data", 0, 0);
             for (uint i = 0; i < files; ++i)
             {
                 InsertFileNode(i);
                 string info = String.Format(Properties.Resources.Str_LoadingMsg, i, files);
                 this.pd.Value   = i;
                 this.pd.Message = info;
                 Status.Text     = info;
                 if (this.pd.HasUserCancelled)
                 {
                     m_Pack.Dispose();
                     this.Close();
                     this.pd.CloseDialog();
                     return;
                 }
                 this.Update();
             }
             m_Root.Expand();
             m_Tree.EndUpdate();
             this.pd.CloseDialog();
             this.Update();
             this.pd.Animation = 150;
             this.pd.ShowDialog(ProgressDialog.PROGDLG.MarqueeProgress, ProgressDialog.PROGDLG.NoCancel);
             this.pd.Caption = Properties.Resources.Str_Sorting;
             this.pd.Message = Properties.Resources.Str_SortingMsg;
             m_Tree.Sort();
             m_Tree.Refresh();
             Status.Text = Properties.Resources.Str_Ready;
             this.Update();
         }
         m_Tree.Enabled = true;
     }
     catch (Exception ex)
     {
         d.Error(ex, this.Name);
     }
     finally
     {
         this.pd.CloseDialog();
     }
 }