//version:1.0
//published by:Ghenadie
//company:http://
//description:
//assembly:AjaxActivities.dll
//namespace:AjaxActivities

function AjaxResponse(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='"+AjaxResponse.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.RegisteredProperties[3] = "RequestActivityName"

	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	
}

AjaxResponse.GetToolboxIcon = function()
{
    return "http://netfxlive.com/images/AjaxResponse.GIF";
}

AjaxResponse.prototype = {
    Initialize : function()
    {
        AddJacks(this);
        for(var i=0;i<activityList.length;i++)
	    {
	        if ((activityList[i] != null) && (activityList[i].element.className == "AjaxRequest"))
	        {
	            this.Properties["RequestActivityName"] = activityList[i].Properties["Name"];
	        }
	    }
    },
    
    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+":AjaxResponse "
        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+":AjaxResponse>"            
        return result
    }    
    
}




