public ZoneButton(WebZone owner, string eventArgument) {
     if (owner == null) {
         throw new ArgumentNullException("owner");
     }
     _owner = owner;
     _eventArgument = eventArgument;
 }
 public ZoneButton(WebZone owner, string eventArgument)
 {
     if (owner == null)
     {
         throw new ArgumentNullException("owner");
     }
     _owner         = owner;
     _eventArgument = eventArgument;
 }
Beispiel #3
0
        protected override void RenderBody(HtmlTextWriter writer)
        {
            base.RenderBodyTableBeginTag(writer);
            if (base.DesignMode)
            {
                base.RenderDesignerRegionBeginTag(writer, Orientation.Vertical);
            }
            CatalogPartCollection catalogParts = this.CatalogParts;

            if ((catalogParts != null) && (catalogParts.Count > 0))
            {
                bool firstCell = true;
                if (catalogParts.Count > 1)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    firstCell = false;
                    this.RenderCatalogPartLinks(writer);
                    writer.RenderEndTag();
                    writer.RenderEndTag();
                }
                System.Web.UI.WebControls.WebParts.CatalogPartChrome catalogPartChrome = this.CatalogPartChrome;
                if (base.DesignMode)
                {
                    foreach (CatalogPart part in catalogParts)
                    {
                        this.RenderCatalogPart(writer, part, catalogPartChrome, ref firstCell);
                    }
                }
                else
                {
                    CatalogPart selectedCatalogPart = this.SelectedCatalogPart;
                    if (selectedCatalogPart != null)
                    {
                        this.RenderCatalogPart(writer, selectedCatalogPart, catalogPartChrome, ref firstCell);
                    }
                }
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                writer.AddStyleAttribute(HtmlTextWriterStyle.Padding, "0");
                writer.AddStyleAttribute(HtmlTextWriterStyle.Height, "100%");
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.RenderEndTag();
                writer.RenderEndTag();
            }
            else
            {
                this.RenderEmptyZoneText(writer);
            }
            if (base.DesignMode)
            {
                WebZone.RenderDesignerRegionEndTag(writer);
            }
            WebZone.RenderBodyTableEndTag(writer);
        }
Beispiel #4
0
 protected override void RenderBody(HtmlTextWriter writer)
 {
     base.RenderBodyTableBeginTag(writer);
     if (base.DesignMode)
     {
         base.RenderDesignerRegionBeginTag(writer, Orientation.Vertical);
     }
     if (this.HasControls())
     {
         bool firstCell = true;
         this.RenderInstructionText(writer, ref firstCell);
         if (this._applyError)
         {
             this.RenderErrorText(writer, ref firstCell);
         }
         System.Web.UI.WebControls.WebParts.EditorPartChrome editorPartChrome = this.EditorPartChrome;
         foreach (EditorPart part in this.EditorParts)
         {
             if (part.Display && part.Visible)
             {
                 writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                 if (!firstCell)
                 {
                     writer.AddStyleAttribute(HtmlTextWriterStyle.PaddingTop, "0");
                 }
                 else
                 {
                     firstCell = false;
                 }
                 writer.RenderBeginTag(HtmlTextWriterTag.Td);
                 editorPartChrome.RenderEditorPart(writer, part);
                 writer.RenderEndTag();
                 writer.RenderEndTag();
             }
         }
         writer.RenderBeginTag(HtmlTextWriterTag.Tr);
         writer.AddStyleAttribute(HtmlTextWriterStyle.Padding, "0");
         writer.AddStyleAttribute(HtmlTextWriterStyle.Height, "100%");
         writer.RenderBeginTag(HtmlTextWriterTag.Td);
         writer.RenderEndTag();
         writer.RenderEndTag();
     }
     else
     {
         this.RenderEmptyZoneText(writer);
     }
     if (base.DesignMode)
     {
         WebZone.RenderDesignerRegionEndTag(writer);
     }
     WebZone.RenderBodyTableEndTag(writer);
 }
 internal void RegisterZone(WebZone zone)
 {
     if (this._pageInitComplete)
     {
         throw new InvalidOperationException(System.Web.SR.GetString("WebPartManager_RegisterTooLate"));
     }
     string iD = zone.ID;
     if (string.IsNullOrEmpty(iD))
     {
         throw new ArgumentException(System.Web.SR.GetString("WebPartManager_NoZoneID"), "zone");
     }
     if (this._zoneIDs.Contains(iD))
     {
         throw new ArgumentException(System.Web.SR.GetString("WebPartManager_DuplicateZoneID", new object[] { iD }));
     }
     this._zoneIDs.Add(iD, zone);
     WebPartZoneBase base2 = zone as WebPartZoneBase;
     if (base2 != null)
     {
         if (this._webPartZones.Contains(base2))
         {
             throw new ArgumentException(System.Web.SR.GetString("WebPartManager_AlreadyRegistered"), "zone");
         }
         this._webPartZones.Add(base2);
         WebPartCollection initialWebParts = base2.GetInitialWebParts();
         ((WebPartManagerControlCollection) this.Controls).AddWebPartsFromZone(base2, initialWebParts);
     }
     else
     {
         ToolZone zone2 = (ToolZone) zone;
         WebPartDisplayModeCollection displayModes = this.DisplayModes;
         WebPartDisplayModeCollection supportedDisplayModes = this.SupportedDisplayModes;
         foreach (WebPartDisplayMode mode in zone2.AssociatedDisplayModes)
         {
             if (displayModes.Contains(mode) && !supportedDisplayModes.Contains(mode))
             {
                 supportedDisplayModes.AddInternal(mode);
             }
         }
     }
 }
        internal void RegisterZone(WebZone zone) {
            Debug.Assert(zone != null);

            if (_pageInitComplete) {
                throw new InvalidOperationException(SR.GetString(SR.WebPartManager_RegisterTooLate));
            }

            string zoneID = zone.ID;
            if (String.IsNullOrEmpty(zoneID)) {
                throw new ArgumentException(SR.GetString(SR.WebPartManager_NoZoneID), "zone");
            }
            if (_zoneIDs.Contains(zoneID)) {
                throw new ArgumentException(SR.GetString(SR.WebPartManager_DuplicateZoneID, zoneID));
            }
            _zoneIDs.Add(zoneID, zone);

            WebPartZoneBase webPartZone = zone as WebPartZoneBase;
            if (webPartZone != null) {
                if (_webPartZones.Contains(webPartZone)) {
                    throw new ArgumentException(SR.GetString(SR.WebPartManager_AlreadyRegistered), "zone");
                }

                _webPartZones.Add(webPartZone);

                WebPartCollection initialWebParts = webPartZone.GetInitialWebParts();
                ((WebPartManagerControlCollection)Controls).AddWebPartsFromZone(webPartZone, initialWebParts);
            }
            else {
                Debug.Assert(zone is ToolZone);
                ToolZone toolZone = (ToolZone)zone;

                WebPartDisplayModeCollection allDisplayModes = DisplayModes;
                WebPartDisplayModeCollection supportedDisplayModes = SupportedDisplayModes;
                foreach (WebPartDisplayMode displayMode in toolZone.AssociatedDisplayModes) {
                    if (allDisplayModes.Contains(displayMode) && !supportedDisplayModes.Contains(displayMode)) {
                        supportedDisplayModes.AddInternal(displayMode);
                    }
                }
            }
        }