Type.registerNamespace('WindowsSite.Ajax.Common');

WindowsSite.Ajax.Common.ControlBaseBehavior = function( element ) 
{
    this._commandName = null;
    this._commandArgument = null;
    WindowsSite.Ajax.Common.ControlBaseBehavior.initializeBase( this, [element] );
}

WindowsSite.Ajax.Common.ControlBaseBehavior.prototype = 
{
    initialize : function() 
    {
        WindowsSite.Ajax.Common.ControlBaseBehavior.callBaseMethod(this, 'initialize');   
    },

    dispose : function() 
    {
        if ( this._onActionDelegate ) this.unregisterApplicationEvents();
        WindowsSite.Ajax.Common.ControlBaseBehavior.callBaseMethod( this, 'dispose' );
    },
    
    add_Handler : function( event, delegate ) {
        $addHandler( this.get_element(), event, delegate );
    },
    
    remove_Handler : function( event, delegate ) {
        $removeHandler( this.get_element(), event, delegate );
    },
    
    _onControlCommand : function( sender, args )
    {}
}

WindowsSite.Ajax.Common.ControlBaseBehavior.registerClass('WindowsSite.Ajax.Common.ControlBaseBehavior', Sys.UI.Control );


WindowsSite.Ajax.Common.CommandEventArgs = function( commandName, commandArgument ) 
{
    WindowsSite.Ajax.Common.CommandEventArgs.initializeBase(this);
    this._commandName = commandName;
    this._commandArgument = commandArgument;
}

WindowsSite.Ajax.Common.CommandEventArgs.prototype =
{
	get_CommandName : function() {	return this._commandName; },
	get_CommandArgument : function() {	return this._commandArgument; }
}
WindowsSite.Ajax.Common.CommandEventArgs.registerClass( 'WindowsSite.Ajax.Common.CommandEventArgs', Sys.EventArgs );