Notify() public static method

Notify about some non-fatal exception. User will see some message.
public static Notify ( [ message, Exception exception = null, IEnumerable solutions = null, [ m = null, [ p = null, [ l = -1 ) : void
message [ Ex.: “Can’t do this and that”.
exception System.Exception Exception which caused the problem.
solutions IEnumerable A bunch of possible solutions.
m [ Member at which error occured.
p [ File at which error occured.
l [ Line at which error occured.
return void
コード例 #1
0
ファイル: ClipboardHelper.cs プロジェクト: windygu/actools
        public static void SetText(string text)
        {
            Exception exception = null;

            for (var i = 0; i < 5; i++)
            {
                try {
                    Clipboard.SetText(text);
                    return;
                } catch (Exception e) {
                    Thread.Sleep(10);
                    exception = e;
                }
            }

            NonfatalError.Notify("Can’t copy text", "No access to clipboard.", exception);
        }
コード例 #2
0
        protected override async Task ExecuteInner()
        {
            try {
                using (var waiting = new WaitingDialog()) {
                    waiting.Report("Solving the issue…");
                    await _execute(waiting.CancellationToken);
                }
            } catch (TaskCanceledException) {
                return;
            } catch (Exception e) {
                NonfatalError.Notify("Can’t solve the issue", e);
                return;
            }

            Solved = true;

            if (_entry != null)
            {
                NonfatalError.Instance.Errors.Remove(_entry);
            }
        }