public CatalogPartChrome(CatalogZoneBase zone) {
     if (zone == null) {
         throw new ArgumentNullException("zone");
     }
     _zone = zone;
     _page = zone.Page;
 }
Пример #2
0
 public CatalogPartChrome(CatalogZoneBase zone)
 {
     if (zone == null)
     {
         throw new ArgumentNullException("zone");
     }
     _zone = zone;
     _page = zone.Page;
 }
Пример #3
0
 internal void SetZone(CatalogZoneBase zone) {
     _zone = zone;
 }
 internal void SetZone(CatalogZoneBase zone)
 {
     this._zone = zone;
 }
        protected internal override void RenderContents(HtmlTextWriter writer)
        {
            // HACK: Need this for child controls to be created at design-time when control is inside template
            EnsureChildControls();

            CatalogZoneBase zone = Zone;

            if (zone != null && !zone.LabelStyle.IsEmpty)
            {
                zone.LabelStyle.AddAttributesToRender(writer, this);
            }
            writer.AddAttribute(HtmlTextWriterAttribute.For, _upload.ClientID);
            writer.RenderBeginTag(HtmlTextWriterTag.Label);
            writer.Write(BrowseHelpText);
            writer.RenderEndTag();
            writer.WriteBreak();

            if (zone != null && !zone.EditUIStyle.IsEmpty)
            {
                _upload.ApplyStyle(zone.EditUIStyle);
            }
            _upload.RenderControl(writer);
            writer.WriteBreak();

            if (zone != null && !zone.LabelStyle.IsEmpty)
            {
                zone.LabelStyle.AddAttributesToRender(writer, this);
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Span);
            writer.Write(UploadHelpText);
            writer.RenderEndTag();
            writer.WriteBreak();

            if (zone != null && !zone.EditUIStyle.IsEmpty)
            {
                _uploadButton.ApplyStyle(zone.EditUIStyle);
            }
            _uploadButton.Text = UploadButtonText;
            _uploadButton.RenderControl(writer);

            if (_importedPartDescription != null || _importErrorMessage != null || DesignMode)
            {
                writer.WriteBreak();
                if (_importErrorMessage != null)
                {
                    if (zone != null && !zone.ErrorStyle.IsEmpty)
                    {
                        zone.ErrorStyle.AddAttributesToRender(writer, this);
                    }
                    writer.RenderBeginTag(HtmlTextWriterTag.Span);
                    writer.Write(PartImportErrorLabelText);
                    writer.RenderEndTag();

                    writer.RenderBeginTag(HtmlTextWriterTag.Hr);
                    writer.RenderEndTag();

                    if (zone != null && !zone.ErrorStyle.IsEmpty)
                    {
                        zone.ErrorStyle.AddAttributesToRender(writer, this);
                    }
                    writer.RenderBeginTag(HtmlTextWriterTag.Span);
                    // We encode the error message because it is user-provided via the import file.
                    writer.WriteEncodedText(_importErrorMessage);
                    writer.RenderEndTag();
                }
                else
                {
                    if (zone != null && !zone.LabelStyle.IsEmpty)
                    {
                        zone.LabelStyle.AddAttributesToRender(writer, this);
                    }
                    writer.RenderBeginTag(HtmlTextWriterTag.Span);
                    writer.Write(ImportedPartLabelText);
                    writer.RenderEndTag();

                    writer.RenderBeginTag(HtmlTextWriterTag.Hr);
                    writer.RenderEndTag();
                }
            }
        }
 public CatalogPartChrome(CatalogZoneBase zone)
 {
 }
        protected internal override void RenderContents(HtmlTextWriter writer)
        {
            this.EnsureChildControls();
            CatalogZoneBase zone = base.Zone;

            if ((zone != null) && !zone.LabelStyle.IsEmpty)
            {
                zone.LabelStyle.AddAttributesToRender(writer, this);
            }
            writer.AddAttribute(HtmlTextWriterAttribute.For, this._upload.ClientID);
            writer.RenderBeginTag(HtmlTextWriterTag.Label);
            writer.Write(this.BrowseHelpText);
            writer.RenderEndTag();
            writer.WriteBreak();
            if ((zone != null) && !zone.EditUIStyle.IsEmpty)
            {
                this._upload.ApplyStyle(zone.EditUIStyle);
            }
            this._upload.RenderControl(writer);
            writer.WriteBreak();
            if ((zone != null) && !zone.LabelStyle.IsEmpty)
            {
                zone.LabelStyle.AddAttributesToRender(writer, this);
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Span);
            writer.Write(this.UploadHelpText);
            writer.RenderEndTag();
            writer.WriteBreak();
            if ((zone != null) && !zone.EditUIStyle.IsEmpty)
            {
                this._uploadButton.ApplyStyle(zone.EditUIStyle);
            }
            this._uploadButton.Text = this.UploadButtonText;
            this._uploadButton.RenderControl(writer);
            if (((this._importedPartDescription != null) || (this._importErrorMessage != null)) || base.DesignMode)
            {
                writer.WriteBreak();
                if (this._importErrorMessage != null)
                {
                    if ((zone != null) && !zone.ErrorStyle.IsEmpty)
                    {
                        zone.ErrorStyle.AddAttributesToRender(writer, this);
                    }
                    writer.RenderBeginTag(HtmlTextWriterTag.Span);
                    writer.Write(this.PartImportErrorLabelText);
                    writer.RenderEndTag();
                    writer.RenderBeginTag(HtmlTextWriterTag.Hr);
                    writer.RenderEndTag();
                    if ((zone != null) && !zone.ErrorStyle.IsEmpty)
                    {
                        zone.ErrorStyle.AddAttributesToRender(writer, this);
                    }
                    writer.RenderBeginTag(HtmlTextWriterTag.Span);
                    writer.WriteEncodedText(this._importErrorMessage);
                    writer.RenderEndTag();
                }
                else
                {
                    if ((zone != null) && !zone.LabelStyle.IsEmpty)
                    {
                        zone.LabelStyle.AddAttributesToRender(writer, this);
                    }
                    writer.RenderBeginTag(HtmlTextWriterTag.Span);
                    writer.Write(this.ImportedPartLabelText);
                    writer.RenderEndTag();
                    writer.RenderBeginTag(HtmlTextWriterTag.Hr);
                    writer.RenderEndTag();
                }
            }
        }
Пример #8
0
 public CatalogPartChrome(CatalogZoneBase zone)
 {
 }