namespace EPiServer.Research.DynamicContent
{ public class FlashDC : IDynamicContent
{
protected PropertyDocumentUrl flash;
protected PropertyNumber width;
protected PropertyNumber height;
/// <summary>
/// Setup properties
/// </summary>
public FlashDC()
{ flash = new PropertyDocumentUrl();
flash.Name = "Flash file ";
width = new PropertyNumber(300);
width.Name = "Width";
height = new PropertyNumber(300);
height.Name = "Height";
}
#region IDynamicContent Members
/// <summary>
/// We'll use the render method instead
/// </summary>
/// <param name="hostPage"></param>
/// <returns></returns>
public System.Web.UI.Control GetControl(PageBase hostPage)
{ throw new NotImplementedException();
}
public EPiServer.Core.PropertyDataCollection Properties
{ get { PropertyDataCollection pdc = new PropertyDataCollection();
pdc.Add(flash);
pdc.Add(width);
pdc.Add(height);
return pdc;
}
}
public string Render(PageBase hostPage)
{ return string.Format("<object width=\"{1}\" height=\"{2}\"><param name=\"movie\" value=\"{0}\"><embed src=\"{0}\" width=\"{1}\" height=\"{2}\"></embed></object>", flash.ToString(), width.ToString(), height.ToString()); }
public bool RendersWithControl
{ get { return false; } }
public string State
{ get
{ return flash.ToString() + "|" + width.ToString() + "|" + height.ToString();
}
set
{ string[] parts = value.Split('|'); if (parts.Length == 3)
{ flash.ParseToSelf(parts[0]);
width.ParseToSelf(parts[1]);
height.ParseToSelf(parts[2]);
}
}
}
#endregion
}
}