https://bugzilla.novell.com/show_bug.cgi?id=430477

User [EMAIL PROTECTED] added comment
https://bugzilla.novell.com/show_bug.cgi?id=430477#c6


Jonathan Pryor <[EMAIL PROTECTED]> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
                 CC|                                                |[EMAIL 
PROTECTED]




--- Comment #6 from Jonathan Pryor <[EMAIL PROTECTED]>  2008-09-29 12:04:46 MDT 
---
It didn't work on .NET because the DefaultTraceListener was handling the
failure message first.  So to see your dialog you'd either have to clear all
the TraceListeners (as you did), or Ignore the first failure dialog, after
which you should see _your_ dialog.  (Yay, two dialogs for every failure
message!)

For Mono integration, I have two suggestions:

1. You should add this to mcs/class/Managed.Windows.Forms and find some
initialization method so that it's always present.  Do NOT call
Debug.Listeners.Clear().

2. More importantly, you should add code so that ShowDebugAssertMsg() grabs the
pre-exising DefaultTraceListener instance, and only shows the UI if
DefaultTraceListener.AssertUiEnabled is true, e.g. (untested):

private DialogResult ShowDebugAssertMsg(string message, string detailMessage)
{
    bool ignore = false;
    foreach (TraceListener tl in Debug.Listeners) {
        DefaultTraceListener d = tl as DefaultTraceListener;
        if (d != null && !d.AssertUiEnabled) {
            ignore = true;
            break;
        }
    }
    if (ignore)
        return DialogResult.Ignore;

    // as before...
}

The reason to do this is that DefaultTraceListener.AssertUiEnabled is
initialized based on the .exe.config file of the loaded app, thus allowing the
UI to be trivially enabled or disabled via the .config file.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to