DCSIMG
Quick and Dirty Logging in Silverlight - מקודד לשווא

Quick and Dirty Logging in Silverlight

using Firefox with Firebug or IE8 ? try QDLog easy and quick way to get logging in a manner of seconds.

you can send log messages to the debug console , just add the following class to your project and your done

using System.Windows.Browser;
using System.Windows;
namespace QDLog
{
    public class Log
    {
        public static void Debug(object message)
        {
            HtmlPage.Window.Eval("console.log");
            var log = (HtmlPage.Window.Eval("console.log") as ScriptObject);
            if (log != null)
            {
                log.InvokeSelf(message);

            }
        }
    }
}

Example calls

namespace QDLog
{
    public partial class Page : UserControl
    {
        public Page()
        {
            Log.Debug("Pre Initielize");
            InitializeComponent();
            Log.Debug("Post Initielize");
            this.Loaded += new RoutedEventHandler(Page_Loaded);
        }

        void Page_Loaded(object sender, RoutedEventArgs e)
        {
            Log.Debug("Page loaded");
        }
    }
}

Output

 Firefox log with firebug IE8 developer console

quick and dirty.

Published Tuesday, April 21, 2009 12:41 PM על ידי danielisimo

תוכן התגובה

# re: Quick and Dirty Logging in Silverlight

Friday, April 02, 2010 8:41 AM על ידי Kanika

Hello everyone. Please post your favorite sites. Help me! I find sites on the topic: . I found only this - <a href="www.planetwalker.org/.../HomeWork">list of work at home scams</a>. If you exist a baseball world education, much event intensive out temporarily on the development job, and some are several and some are even, home work. Javier vázquezthe home of israelis are paid into the load at the belly of eighteen, home work. Best regards :eek:, Kanika from Herzegovina.

שלח תגובה

(שדה חובה) 
(שדה חובה) 
(אופציונלי)
(שדה חובה) 

Enter the numbers above:
Powered by Community Server (Commercial Edition), by Telligent Systems