コード例 #1
0
ファイル: Helper.cs プロジェクト: Gullus/JgMaschine
        public static void InfoBox(string FehlerText, Exception Fehler, ProtokollArt ProtokollArt = ProtokollArt.Fehler)
        {
            var msg     = $"{FehlerText}\nGrund: {Fehler.Message}";
            var inExcep = Fehler.InnerException;
            int zaehler = 0;

            while (inExcep != null)
            {
                zaehler++;
                msg    += $"\nInExcep {zaehler}: {inExcep.Message}";
                inExcep = inExcep.InnerException;
            }

            InfoBox(msg, ProtokollArt);
        }
コード例 #2
0
ファイル: Helper.cs プロジェクト: Gullus/JgMaschine
        public static void InfoBox(string ProtokollText, ProtokollArt ProtokollArt = ProtokollArt.Fehler)
        {
            string         caption = "Fehler!";
            MessageBoxIcon icon    = MessageBoxIcon.Error;

            switch (ProtokollArt)
            {
            case ProtokollArt.Info:
                caption = "Information";
                icon    = MessageBoxIcon.Information;
                break;

            case ProtokollArt.Warnung:
                caption = "Warnung!";
                icon    = MessageBoxIcon.Warning;
                break;
            }
            MessageBox.Show(ProtokollText, caption, MessageBoxButtons.OK, icon);
        }