﻿
var srcViewMgr = new SourceViewManager();

function createSilverlight( projectID )
{
    srcViewMgr.projectID = projectID;

    Silverlight.createObjectEx( {
        source: 'SourceCodeView.xaml',
        parentElement: document.getElementById( 'htmlSourceMgr' ),
        id: 'srcCodeView',
        properties: {
            width: '100%',
            height: '100%',
            background: 'transparent',
            isWindowless: 'true',
            version: '1.0'
        },
        events: {
            onError: null,
            onLoad: Utils.createDelegate( srcViewMgr, srcViewMgr.loadHandler )
        },
        context: null 
    } );
}

if( !window.Utils )
	window.Utils = {};

Utils.createDelegate = function( instance, method )
{
	return function() {
        return method.apply( instance, arguments );
    }
}

