//version:1.0
//published by:Ghenadie
//company:http://
//description:
//assembly:AjaxActivities.dll
//namespace:AjaxActivities

function AjaxRequest(element) {
	this.element = element;
	element.style.fontFamily = "Arial, sans-serif";
	element.style.fontSize = "14px";
	element.style.border="1px solid #aaa";
	element.style.padding="0px";
	element.style.width="100px";
	element.style.height="50px";
    element.style.margin="5px";
    element.style.backgroundColor="lightyellow";
    element.style.zIndex=1;
    element.style.cursor="default";	
	element.innerHTML = "<table class='activitytable' height='100%'><tr><td valign='center'><img src='"+AjaxRequest.GetToolboxIcon()+"'></td><td valign='center'><DIV id='"+element.id+"_id' class='idlabel'>"+element.id+"</DIV></td><td align='right' class='jacks'></td></tr></table>"	
	this.group = Quanticks.drag().createSimpleActivity(element)
	this.Properties = new Array()
	this.RegisteredProperties = new Array()
	this.RegisteredProperties[0] = "Name"
	this.RegisteredProperties[1] = "Description"
	this.RegisteredProperties[2] = "Enabled"	

	this.BindableProperties = new Array()
    this.Parameters = new Array()
    this.ParameterValues = new Array()
    
	this.EnumProperties = new Array()
	this.EnumValues = new Array()	
		
	this.ActWidth = 100
	this.BlockWidth = 100	
}

AjaxRequest.GetToolboxIcon = function()
{
    //to have activity image extracted from dll resources return Images/<ActivityName>.GIF
    return "http://netfxlive.com/images/AjaxRequest.GIF";
}

AjaxRequest.prototype = {
    Initialize : function()
    {
        //AddJacks will add a little square to the right side of the activity for each bindable property to enable drag/drop bind with pipes
        //element innerHTML must have a td element of class "jacks"
        AddJacks(this);
    },
    
    Serialize : function()
    {
        var nsIndex = namespaces.length + 1;
        namespaces[namespaces.length] = "xmlns:ns"+nsIndex+"=\"clr-namespace:AjaxActivities;Assembly=AjaxActivities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\"";
        var activityFactory = Quanticks.activityFactory()
        var result = "";
        result += "<ns"+nsIndex+":AjaxRequest "
        for (var propi = 0;propi<this.RegisteredProperties.length;propi++)
        {
            if (this.RegisteredProperties[propi]=="Name")
                result += "x:";
            if (typeof this.Properties[this.RegisteredProperties[propi]] != "undefined" && this.Properties[this.RegisteredProperties[propi]]!="")
                result += this.RegisteredProperties[propi]+"=\""+this.Properties[this.RegisteredProperties[propi]]+"\" ";
        }
        result += ">\n"  
        result += SerializeParameters(this);     
        result += "</ns"+nsIndex+":AjaxRequest>";     
        return result;
    } 
    
    //if no Deserialize function specified, a default serializer will be used.
    //Default serializer will create a xoml node and add all property values as attributes.
    
}



