public override void Initialize(IComponent component)
 {
     ControlDesigner.VerifyInitializeArgument(component, typeof(WebPartZone));
     base.Initialize(component);
     this._zone = (WebPartZone) component;
 }
Exemple #2
0
 public void AddWebPartUserControl(WebPartInfo info, WebPartZone zone, int zoneIndex)
 {
     int titleLength = (info.Zone == Classes.WebPartZone.HomePageLeftZone) ? 13 : 25;
     var uc = (WebPartUserControl) zone.Page.LoadControl(info.ControlPath);
     uc.DataBind();
     uc.ID = info.Name;
     GenericWebPart part = CreateWebPart(uc);
     part.Title = info.Name.Translate();
     if (part.Title.Length > titleLength) part.Title = part.Title.Substring(0, titleLength) + "..";
     part.AllowClose = true;
     part.AllowEdit = true;
     part.AllowHide = true;
     part.AllowMinimize = true;
     part.AllowZoneChange = true;
     AddWebPart(part, zone, zoneIndex);
     part.DataBind();
 }