Exemplo n.º 1
0
        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            string title = CurrentControl.Title;
            if (String.IsNullOrEmpty(title))
            {
                title = String.Format("[{0}]", CurrentControl.ID);
            }

            EditableDesignerRegion itemsRegion = new EditableDesignerRegion(this, "Items", true);
            regions.Add(itemsRegion);

            string itemsContent = String.Format("<div style=\"border:solid 1px #ccc;\"><div style=\"font-size:11px;background-color:#ddd;\">Items</div><div style=\"padding:2px;\" {0}=\"{1}\">{2}</div></div>",
                DesignerRegion.DesignerRegionAttributeName, "0", GetEditableDesignerRegionContent(itemsRegion));


            string toolbarsContent = "";

            if (CurrentControl.Toolbars.Count > 0)
            {
                EditableDesignerRegion toolbarsRegion = new EditableDesignerRegion(this, "Toolbars", true);
                regions.Add(toolbarsRegion);

                toolbarsContent = String.Format("<div style=\"border:solid 1px #ccc;margin-bottom:5px;\"><div style=\"font-size:11px;background-color:#ddd;\">Toolbars</div><div style=\"padding:2px;\" {0}=\"{1}\">{2}</div></div>",
                    DesignerRegion.DesignerRegionAttributeName, "1", GetEditableDesignerRegionContent(toolbarsRegion));
            }
            
            return String.Format(TEMPLATE, title, toolbarsContent, itemsContent);
        }
 protected virtual void AddDesignerRegions(DesignerRegionCollection regions)
 {
     if (this.SupportsDesignerRegions)
     {
         foreach (WizardStepBase base2 in this._wizard.WizardSteps)
         {
             if (base2 is TemplatedWizardStep)
             {
                 TemplateDefinition templateDefinition = new TemplateDefinition(this, "ContentTemplate", this._wizard, "ContentTemplate", this.TemplateStyleArray[5]);
                 DesignerRegion region = new WizardStepTemplatedEditableRegion(templateDefinition, base2) {
                     Description = System.Design.SR.GetString("ContainerControlDesigner_RegionWatermark")
                 };
                 regions.Add(region);
             }
             else
             {
                 DesignerRegion region2 = new WizardStepEditableRegion(this, base2) {
                     Description = System.Design.SR.GetString("ContainerControlDesigner_RegionWatermark")
                 };
                 regions.Add(region2);
             }
         }
         foreach (WizardStepBase base3 in this._wizard.WizardSteps)
         {
             regions.Add(new WizardSelectableRegion(this, "Move to " + this.GetRegionName(base3), base3));
         }
     }
 }
Exemplo n.º 3
0
        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            this.CreateChildControls();

            for (int i = 0; i < _nbRegions; i++)
            {

                DesignerRegion r;

                if (_currentRegion == i)

                    r = new EditableDesignerRegion(this, i.ToString());

                else

                    r = new DesignerRegion(this, i.ToString());

                regions.Add(r);

            }

            if ((_currentRegion >= 0) && (_currentRegion < _nbRegions))

                regions[_currentRegion].Highlight = true;

            return base.GetDesignTimeHtml(regions);
        }
 public override string GetDesignTimeHtml(DesignerRegionCollection regions)
 {
     try
     {
         WebPartZone viewControl = (WebPartZone) base.ViewControl;
         bool flag = base.UseRegions(regions, this._zone.ZoneTemplate, viewControl.ZoneTemplate);
         if ((viewControl.ZoneTemplate == null) && !flag)
         {
             return this.GetEmptyDesignTimeHtml();
         }
         ((ICompositeControlDesignerAccessor) viewControl).RecreateChildControls();
         if (flag)
         {
             viewControl.Controls.Clear();
             WebPartEditableDesignerRegion region = new WebPartEditableDesignerRegion(viewControl, base.TemplateDefinition) {
                 IsSingleInstanceTemplate = true,
                 Description = System.Design.SR.GetString("ContainerControlDesigner_RegionWatermark")
             };
             regions.Add(region);
         }
         return base.GetDesignTimeHtml();
     }
     catch (Exception exception)
     {
         return this.GetErrorDesignTimeHtml(exception);
     }
 }
 public ViewRendering GetViewRendering(Control control)
 {
     string str2;
     DesignerRegionCollection regions;
     CatalogPart part = control as CatalogPart;
     if (part == null)
     {
         return new ViewRendering(ControlDesigner.CreateErrorDesignTimeHtml(System.Design.SR.GetString("CatalogZoneDesigner_OnlyCatalogParts"), null, control), new DesignerRegionCollection());
     }
     try
     {
         IDictionary data = new HybridDictionary(1);
         data["Zone"] = base.Zone;
         ((IControlDesignerAccessor) part).SetDesignModeState(data);
         this._partViewRendering = ControlDesigner.GetViewRendering(part);
         regions = this._partViewRendering.Regions;
         StringWriter writer = new StringWriter(CultureInfo.InvariantCulture);
         this.RenderCatalogPart(new DesignTimeHtmlTextWriter(writer), (CatalogPart) PartDesigner.GetViewControl(part));
         str2 = writer.ToString();
     }
     catch (Exception exception)
     {
         str2 = ControlDesigner.CreateErrorDesignTimeHtml(System.Design.SR.GetString("ControlDesigner_UnhandledException"), exception, control);
         regions = new DesignerRegionCollection();
     }
     return new ViewRendering(str2, regions);
 }
        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            PrintLabel printLabel = Component as PrintLabel;

            HtmlTextWriter htmlWriter = new HtmlTextWriter(new StringWriter());
            printLabel.RenderControl(htmlWriter);
            return htmlWriter.InnerWriter.ToString();
        }
Exemplo n.º 7
0
        public override string GetDesignTimeHtml(System.Web.UI.Design.DesignerRegionCollection regions)
        {
            regions.Clear();
            DesignerRegion content = new DesignerRegion(this, "0", true);

            regions.Add(content);
            return(base.GetDesignTimeHtml(regions));
        }
        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            var chart = (ChartBase)Component;
            var stringBuilder = new StringBuilder(1024);
            stringBuilder.AppendFormat("<div style=\"width: {0}px; height:{1}px;border-style: solid; border-width: 1px;\">", chart.ChartWidth, chart.ChartHeight);

            return stringBuilder.ToString();
        }
 public override string GetDesignTimeHtml(DesignerRegionCollection regions)
 {
     EditableDesignerRegion region = new EditableDesignerRegion(this, "Text") {
         Description = System.Design.SR.GetString("LocalizeDesigner_RegionWatermark")
     };
     region.Properties[typeof(Control)] = base.Component;
     regions.Add(region);
     return string.Format(CultureInfo.InvariantCulture, "<span {0}=0></span>", new object[] { DesignerRegion.DesignerRegionAttributeName });
 }
        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            this.FrameStyle.BackColor = Color.White;
            this.FrameStyle.BorderColor = Color.LightGray;
            this.FrameStyle.BorderWidth = Unit.Pixel(1);

            RoundedPanel roundPanel = (RoundedPanel)Component;
            return (roundPanel.GetBeginTag() + base.GetDesignTimeHtml(regions) + roundPanel.GetEndTag());
        }
 public override string GetDesignTimeHtml(DesignerRegionCollection regions)
 {
     StringBuilder sb = new StringBuilder(1024);
     StringWriter sr = new StringWriter(sb, CultureInfo.InvariantCulture);
     HtmlTextWriter writer = new HtmlTextWriter(sr);
     AsyncFileUpload.CreateChilds();
     AsyncFileUpload.RenderControl(writer);
     return sb.ToString();
 }
 public override string GetDesignTimeHtml(DesignerRegionCollection regions)
 {
     IDesignerHost service = (IDesignerHost) this.GetService(typeof(IDesignerHost));
     if (!(service.RootComponent is MasterPage))
     {
         throw new InvalidOperationException(System.Design.SR.GetString("ContentPlaceHolder_Invalid_RootComponent"));
     }
     regions.Add(new EditableDesignerRegion(this, "Content"));
     return this.CreateDesignTimeHTML();
 }
Exemplo n.º 13
0
        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            EditableDesignerRegion editableRegion = new EditableDesignerRegion(this, "Content", true);
            regions.Add(editableRegion);

            string content = String.Format("<div {0}='{1}'>{2}</div>",
                DesignerRegion.DesignerRegionAttributeName, 0, GetEditableDesignerRegionContent(editableRegion));

            return content;
        }
 public override string GetDesignTimeHtml(DesignerRegionCollection regions)
 {
     EditableDesignerRegion region = new EditableDesignerRegion(this, "Content");
     regions.Add(region);
     Font captionFont = SystemFonts.CaptionFont;
     Color controlText = SystemColors.ControlText;
     Color control = SystemColors.Control;
     string str = base.Component.GetType().Name + " - " + base.Component.Site.Name;
     return string.Format(CultureInfo.InvariantCulture, "<table cellspacing=0 cellpadding=0 style=\"border:1px solid black; width:100%; height:200px\">\r\n            <tr>\r\n              <td style=\"width:100%; height:25px; font-family:Tahoma; font-size:{2}pt; color:{3}; background-color:{4}; padding:5px; border-bottom:1px solid black;\">\r\n                &nbsp;{0}\r\n              </td>\r\n            </tr>\r\n            <tr>\r\n              <td style=\"width:100%; height:175px; vertical-align:top;\" {1}=\"0\">\r\n              </td>\r\n            </tr>\r\n          </table>", new object[] { str, DesignerRegion.DesignerRegionAttributeName, captionFont.SizeInPoints, ColorTranslator.ToHtml(controlText), ColorTranslator.ToHtml(control) });
 }
Exemplo n.º 15
0
        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            if (CurrentControl.Tabs.Count == 0)
            {
                return GetEmptyDesignTimeHtml();
            }


            // 1. Add tabs title list
            StringBuilder sb = new StringBuilder();
            int tabIndex = 0;
            foreach (Tab tab in CurrentControl.Tabs)
            {
                HtmlNodeBuilder nb = new HtmlNodeBuilder("div");

                if (!String.IsNullOrEmpty(tab.Title))
                {
                    nb.InnerProperty = tab.Title;
                }
                else
                {
                    nb.InnerProperty = String.Format("[{0}]", tab.ID);
                }

                string styleStr = "padding:0 5px;margin-right:5px;display:inline;";
                if (CurrentControl.ActiveTabIndex == tabIndex)
                {
                    styleStr += "background-color:#666;";
                }
                nb.SetProperty("style", styleStr);

                nb.SetProperty(DesignerRegion.DesignerRegionAttributeName, tabIndex.ToString());

                DesignerRegion region = new DesignerRegion(this, "Tab_" + tabIndex, true);
                region.Properties["TabIndex"] = tabIndex.ToString();
                regions.Add(region);

                sb.Append(nb.ToString());
                tabIndex++;
            }
            string tabsHtml = sb.ToString();


            // 2. Add current active tab content
            // Note: Currently, we have add (CurrentControl.Tabs.Count - 1) items into regions,
            // So This editable region's index is CurrentControl.Tabs.Count.
            EditableDesignerRegion editableRegion = new EditableDesignerRegion(this, "Content", true);
            regions.Add(editableRegion);
            //editableRegion.Properties["ActiveTabIndex"] = CurrentControl.ActiveTabIndex.ToString();

            string contentHtml = String.Format("<div {0}='{1}'>{2}</div>",
                 DesignerRegion.DesignerRegionAttributeName, CurrentControl.Tabs.Count, GetEditableDesignerRegionContent(editableRegion));

            return String.Format(PANEL_TEMPLATE, tabsHtml, contentHtml);
        }
        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            var controlPreviewHtml =
                @"<div class=""ajax__fileupload"" id=""SampleContent_AjaxFileUpload1_ctl00"" style=""padding: 4px;border: #D3D3D3 1px solid;overflow: auto;"">
                    <div style=""width: 100%; height: 60px; visibility: visible; border-style: dotted; border-width: 1px; line-height: 50px; text-align: center; margin-bottom: 2px;"">Drop files here</div>
                    <span style=""display: inline-block;overflow: hidden;position: relative;width: 80px;height: 24px;line-height: 24px;"">
                    <span style=""display: block;height: 24px;line-height: 24px;width: 80px;text-align: center;background-color: #212121;color: #D0D0D0;cursor: pointer;margin-right: 4px;font-size: 13px;"">Select File</span>
                    <div style=""overflow: hidden;"">
                    <div style=""visibility: visible;border: #A9A9A9 1px solid;border-width: 1px;margin-top: 2px;padding: 4px;clear: both;""></div></div></span>
                    <div style=""visibility: visible;border: #A9A9A9 1px solid;border-width: 1px;margin-top: 2px;padding: 4px;clear: both;"">
                        <div style=""position: relative;z-index: 0; color: #009; line-height: 20px;line-height: 20px;height: 20px;margin-bottom: 2px;overflow: hidden;"">
                        <div style=""display: inline-block;"" class=""pendingState"">
                        <span class=""ajax__fileupload_fileItemInfo"">
                            <span>File 1.jpg</span> <span class=""filetype"">(image/jpeg)</span>
                            -
                            <span>1.28 MB</span>
                        </span>
                        <span> (uploading)</span></div>
                        <div style=""cursor: pointer;background-color: #900;color: white;width: 55px;height: 20px;line-height: 20px;text-align: center;display: block;float: left;position: absolute;top: 0;right: 0;"">Remove</div>
                        </div>

                        <div style=""position: relative;z-index: 0; color: #009; line-height: 20px;line-height: 20px;height: 20px;margin-bottom: 2px;overflow: hidden;"">
                        <div style=""display: inline-block;"" class=""pendingState"">
                        <span class=""ajax__fileupload_fileItemInfo"">
                            <span>File 2.jpg</span> <span class=""filetype"">(image/jpeg)</span>
                            -
                            <span>2.18 MB</span>
                        </span>
                        <span> (pending)</span></div>
                        <div style=""cursor: pointer;background-color: #900;color: white;width: 55px;height: 20px;line-height: 20px;text-align: center;display: block;float: left;position: absolute;top: 0;right: 0;"">Remove</div>
                        </div>

                        <div style=""position: relative;z-index: 0; color: #009; line-height: 20px;line-height: 20px;height: 20px;margin-bottom: 2px;overflow: hidden;"">
                        <div style=""display: inline-block;"" class=""pendingState"">
                        <span class=""ajax__fileupload_fileItemInfo"">
                            <span>File 3.jpg</span> <span class=""filetype"">(image/jpeg)</span>
                            -
                            <span>99 MB</span>
                        </span>
                        <span> (pending)</span></div>
                        <div style=""cursor: pointer;background-color: #900;color: white;width: 55px;height: 20px;line-height: 20px;text-align: center;display: block;float: left;position: absolute;top: 0;right: 0;"">Remove</div>
                        </div>
                    </div>

                    <div align=""right"" style=""margin-top: 2px;line-height: 20px;height: 20px;"">
                        <div>
                            <div align=""left"" style=""width: 80%; float: left; line-height: 20px;"">
                            <div style=""width: 65%; height: 20px; overflow: visible; white-space: nowrap;padding-left: 4px;background-color: #CCFFCC;"">uploaded 65%</div></div>
                        </div>
                        <div style=""width: 60px;text-align: center;cursor: pointer;color: white;font-weight: bold;background-color: #000099; line-height: 20px;"">Upload</div>
                    </div>
                </div>";

            return controlPreviewHtml;
        }
 public override string GetDesignTimeHtml(DesignerRegionCollection regions)
 {
     StringBuilder sb = new StringBuilder();
     sb.Append(@"<table style=""border:1px solid #CCC"">");
     EditableDesignerRegion region = GetEditableRegion(_Control.FirstTemplate, "First", "0", sb);
     EditableDesignerRegion region2 = GetEditableRegion(_Control.SecondTemplate, "Second", "1", sb);
     sb.Append("</table>");
     regions.Add(region);
     regions.Add(region2);
     return sb.ToString();
 }
Exemplo n.º 18
0
		public override string GetDesignTimeHtml(DesignerRegionCollection regions)
		{
			string html;
			try
			{
				html = base.GetDesignTimeHtml();
			}
			catch (Exception exception)
			{
				html = this.GetErrorDesignTimeHtml(exception);
			}
			return html;
		}
Exemplo n.º 19
0
 public override string GetDesignTimeHtml(DesignerRegionCollection regions)
 {
     StringBuilder sb = new StringBuilder(1024);
     StringWriter sr = new StringWriter(sb, CultureInfo.InvariantCulture);
     HtmlTextWriter writer = new HtmlTextWriter(sr);
     writer.AddAttribute(HtmlTextWriterAttribute.Rel, "stylesheet");
     writer.AddAttribute(HtmlTextWriterAttribute.Href, Editor.Page.ClientScript.GetWebResourceUrl(typeof(AjaxControlToolkit.HTMLEditor.Editor),"AjaxControlToolkit.HTMLEditor.Editor.css"));
     writer.RenderBeginTag(HtmlTextWriterTag.Link);
     writer.RenderEndTag();
     Editor.CreateChilds(this);
     Editor.RenderControl(writer);
     return sb.ToString();
 }
 private string GetDesignTimeHtmlHelper(bool useRegions, DesignerRegionCollection regions)
 {
     System.Web.UI.WebControls.View component = (System.Web.UI.WebControls.View) base.Component;
     if (!(component.Parent is MultiView))
     {
         return base.CreateInvalidParentDesignTimeHtml(typeof(System.Web.UI.WebControls.View), typeof(MultiView));
     }
     if (useRegions)
     {
         return base.GetDesignTimeHtml(regions);
     }
     return base.GetDesignTimeHtml();
 }
        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            Control component = (Control)base.Component;

            component.Controls.Clear();
            EditableDesignerRegion region = new EditableDesignerRegion(this, "Content")
            {
                Description = System.Design.SR.GetString("ContainerControlDesigner_RegionWatermark")
            };

            region.Properties[typeof(Control)] = component;
            region.EnsureSize = true;
            regions.Add(region);
            return(this.GenerateDesignTimeHtml());
        }
Exemplo n.º 22
0
        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            EditableDesignerRegion editableRegion = new EditableDesignerRegion(this, "Content", true);
            regions.Add(editableRegion);

            string title = CurrentControl.Title;
            if (String.IsNullOrEmpty(title))
            {
                title = String.Format("[{0}]", CurrentControl.ID);
            }
            string content = String.Format("<div {0}='{1}'>{2}</div>",
                DesignerRegion.DesignerRegionAttributeName, 0, GetEditableDesignerRegionContent(editableRegion));

            return String.Format(PANEL_TEMPLATE, title, content);
        }
        public override String GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            int i = 0;
            foreach (TabPage tabPage in tabControl.TabPages)
            {
                regions.Add(new DesignerRegion(this, HEADER_PREFIX + i.ToString()));
                i++;
            }

            EditableDesignerRegion editableRegion =
                new EditableDesignerRegion(this,
                    CONTENT_PREFIX + tabControl.CurrentDesignTab, false);
            regions.Add(editableRegion);
            regions[tabControl.CurrentDesignTab].Highlight = true;
            return base.GetDesignTimeHtml();
        }
Exemplo n.º 24
0
        public override string XGetDesignTimeHtml(DesignerRegionCollection regions)
        {
            //if (DTEUtilities.Connect())
            //{
            //    // Make an approximate calculation for the current designer window height.
            //    EnvDTE._DTE dte = DTEUtilities._application;
            //    int offset = ((this.Control.ResourceManager.Hide) ? 42 : 143);
            //    this.height = dte.ActiveWindow.Height - offset;
            //}
            
            //EnvDTE.DTE dte = (EnvDTE.DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.9.0");
            //int offset = ((this.Control.ResourceManager.Hide) ? 42 : 143);
            //this.height = dte.ActiveWindow.Height - offset;



            designerRegions = regions;

            StringBuilder sb = new StringBuilder(256);

            if (this.viewPort.LayoutControl == null)
            {
                sb.Append(begin);

                object[] prms = new object[]
                    {
                        this.GetWebResourceUrl("Ext.Net.Build.Ext.Net.icons.add.png"),
                        this.GetDesignerRegionAttribute(ViewportClickAction.AddBorderLayout),
                        this.GetDesignerRegionAttribute(ViewportClickAction.AddFitLayout),
                        this.GetDesignerRegionAttribute(ViewportClickAction.AddAccordion)
                    };

                sb.AppendFormat(content, prms);
                sb.AppendFormat(editor, GetEditableDesignerAttribute(), 100);
                sb.Append(end);
            }
            else
            {
                if (!this.viewPort.Height.IsEmpty)
                {
                    this.height = (int)this.viewPort.Height.Value;
                }
                sb.AppendFormat(editor, GetEditableDesignerAttribute(), this.height);
            }

            return sb.ToString();
        }
Exemplo n.º 25
0
        public override string XGetDesignTimeHtml(DesignerRegionCollection regions)
        {
            EditableDesignerRegion region = new EditableDesignerRegion(this, "Body", false);
            regions.Add(region);

            StringWriter writer = new StringWriter(CultureInfo.CurrentCulture);
            HtmlTextWriter htmlWriter = new HtmlTextWriter(writer);

            FieldSet c = (FieldSet)this.Control;

            string width = " width: {0};".FormatWith(c.Width.ToString());
            string height = " height: {0}px;".FormatWith((c.Height.Value - 39).ToString());

            string buttons = "";
            buttons += (c.CheckboxToggle && !c.Collapsible) ? "<input name=\"ext-comp-1002-checkbox\" type=\"checkbox\">" : "";
            buttons += (c.Collapsible && !c.CheckboxToggle) ? "<div class=\"x-tool x-tool-toggle\">&nbsp;</div>" : "";
            
            /*
             * 0 - ClientID
             * 1 - Title
             * 2 - Width
             * 3 - Height
             * 4 - Buttons
             * 5 - BodyStyle
             */

            object[] args = new object[6];
            args[0] = c.ClientID;
            args[1] = c.Title;
            args[2] = width;
            args[3] = height;
            args[4] = buttons;
            args[5] = c.BodyStyle;

            LiteralControl topCtrl = new LiteralControl(string.Format(this.HtmlBegin, args));
            topCtrl.RenderControl(htmlWriter);

            HtmlGenericControl div = (HtmlGenericControl)c.ContentContainer;
            div.Attributes[DesignerRegion.DesignerRegionAttributeName] = "0";
            div.InnerHtml = this.GetEditableDesignerRegionContent(region);
            div.RenderControl(htmlWriter);

            LiteralControl bottomCtrl = new LiteralControl(this.HtmlEnd);
            bottomCtrl.RenderControl(htmlWriter);

            return writer.ToString();
        }
Exemplo n.º 26
0
        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            StringBuilder sb = new StringBuilder();

            int rowIndex = 0;
            foreach (FormRow row in CurrentControl.Rows)
            {
                #region oldcode
                //bool showInnerTable = row.Fields.Count > 1 ? true : false;
                //if (showInnerTable)
                //{
                //    sb.Append("<table cellpadding='0' cellspacing='2' border='0' width='100%'><tbody><tr>");
                //}

                //int columnIndex = 0;
                //foreach (Field field in row.Fields)
                //{
                //if (showInnerTable)
                //{
                //    sb.Append("<td>");
                //} 
                #endregion

                string regionName = String.Format("{0}_{1}", EDITOR_REGION_PREFIX, rowIndex);
                EditableDesignerRegion editableRegion = new EditableDesignerRegion(this, regionName, false);
                editableRegion.Properties["RowIndex"] = rowIndex;
                regions.Add(editableRegion);

                sb.AppendFormat("<div style='margin:2px;' {0}='{1}'>{2}</div>",
                    DesignerRegion.DesignerRegionAttributeName, rowIndex, GetEditableDesignerRegionContent(editableRegion));

                rowIndex++;
            }


            string title = CurrentControl.Title;
            if (String.IsNullOrEmpty(title))
            {
                title = String.Format("[{0}]", CurrentControl.ID);
            }

            string content = String.Format(PANEL_TEMPLATE, title, sb.ToString());


            return content;
        }
Exemplo n.º 27
0
        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            //// Width and Height
            //string sizeStyle = String.Empty;
            //if (CurrentControl.Width != Unit.Empty)
            //{
            //    sizeStyle += String.Format("width:{0}px;", CurrentControl.Width);
            //}
            //if (CurrentControl.Height != Unit.Empty)
            //{
            //    sizeStyle += String.Format("height:{0}px;", CurrentControl.Height);
            //}

            // Title
            string title = CurrentControl.Title;
            if (String.IsNullOrEmpty(title))
            {
                title = String.Format("[{0}]", CurrentControl.ID);
            }

            // Items
            EditableDesignerRegion itemsRegion = new EditableDesignerRegion(this, "Items", true);
            regions.Add(itemsRegion);

            string itemsContent = String.Format("<div style=\"border:solid 1px #ccc;font-size:11px;background-color:#ddd;\">Items</div><div style=\"padding:2px;\" {0}=\"{1}\"></div>",
                DesignerRegion.DesignerRegionAttributeName, "0"); //GetEditableDesignerRegionContent(itemsRegion));

            // Toolbars
            string toolbarsContent = "";
            if (CurrentControl.Toolbars.Count > 0)
            {
                EditableDesignerRegion toolbarsRegion = new EditableDesignerRegion(this, "Toolbars", true);
                regions.Add(toolbarsRegion);

                toolbarsContent = String.Format("<div style=\"border:solid 1px #ccc;font-size:11px;background-color:#ddd;\">Toolbars</div><div style=\"padding:2px;\" {0}=\"{1}\"></div>",
                    DesignerRegion.DesignerRegionAttributeName, "1");
            }

            return String.Format(PANEL_TEMPLATE, title, toolbarsContent + itemsContent);
        }
 public ViewRendering GetViewRendering(Control control)
 {
     string str;
     DesignerRegionCollection regions;
     try
     {
         this._partViewRendering = ControlDesigner.GetViewRendering(control);
         regions = this._partViewRendering.Regions;
         WebPart part = control as WebPart;
         if (part == null)
         {
             part = new DesignerGenericWebPart(PartDesigner.GetViewControl(control));
         }
         StringWriter writer = new StringWriter(CultureInfo.InvariantCulture);
         this.RenderWebPart(new DesignTimeHtmlTextWriter(writer), (WebPart) PartDesigner.GetViewControl(part));
         str = writer.ToString();
     }
     catch (Exception exception)
     {
         str = ControlDesigner.CreateErrorDesignTimeHtml(System.Design.SR.GetString("ControlDesigner_UnhandledException"), exception, control);
         regions = new DesignerRegionCollection();
     }
     StringWriter writer2 = new StringWriter(CultureInfo.InvariantCulture);
     DesignTimeHtmlTextWriter writer3 = new DesignTimeHtmlTextWriter(writer2);
     bool flag = base.Zone.LayoutOrientation == Orientation.Horizontal;
     if (flag)
     {
         writer3.AddStyleAttribute("display", "inline-block");
         writer3.AddStyleAttribute(HtmlTextWriterStyle.Height, "100%");
         writer3.RenderBeginTag(HtmlTextWriterTag.Span);
     }
     writer3.Write(str);
     if (flag)
     {
         writer3.RenderEndTag();
     }
     return new ViewRendering(writer2.ToString(), regions);
 }
Exemplo n.º 29
0
        public override string GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            Table tabViewTable = (Table)tabView.Controls[0];
              int i = 0, designerRegionIndex = 0;
              string designTimeHtml = "";

              if (tabViewTable.Rows.Count > 0)
              {
            Table headerTable = (Table)tabViewTable.Rows[0].Cells[0].Controls[0];
            for (i = 0; i < headerTable.Rows[0].Cells.Count; i++)
            {
              regions.Add(new DesignerRegion(this, "Header" + designerRegionIndex.ToString()));
              ++designerRegionIndex;
            }

            Table contentTable = (Table)tabViewTable.Rows[1].Cells[0].Controls[0];
            //for (i = 1; i < /*2*/tabView.Tabs.Count; i++)
            //for (i = 0; i < /*2*/tabView.Tabs.Count; i++)
            {
              EditableDesignerRegion editableRegion =
            new EditableDesignerRegion(this,
                "Content" + tabView.CurrentTabIndex, false);
              ++designerRegionIndex;
              editableRegion.UserData = i;
              regions.Add(editableRegion);
            }

            //Set the highlight for the selected region
            if (tabView.Tabs.Count > 0)
              regions[tabView.CurrentTabIndex].Highlight = true;

            designTimeHtml = base.GetDesignTimeHtml(regions);
              }
              else designTimeHtml = GetDesignTimeHtml();

              return designTimeHtml;
        }
 public override string GetDesignTimeHtml(DesignerRegionCollection regions)
 {
     string emptyDesignTimeHtml;
     try
     {
         CatalogZone viewControl = (CatalogZone) base.ViewControl;
         bool flag = base.UseRegions(regions, this._zone.ZoneTemplate, viewControl.ZoneTemplate);
         if ((viewControl.ZoneTemplate == null) && !flag)
         {
             emptyDesignTimeHtml = this.GetEmptyDesignTimeHtml();
         }
         else
         {
             ((ICompositeControlDesignerAccessor) viewControl).RecreateChildControls();
             if (flag)
             {
                 viewControl.Controls.Clear();
                 CatalogPartEditableDesignerRegion region = new CatalogPartEditableDesignerRegion(viewControl, base.TemplateDefinition);
                 region.Properties[typeof(Control)] = viewControl;
                 region.IsSingleInstanceTemplate = true;
                 region.Description = System.Design.SR.GetString("ContainerControlDesigner_RegionWatermark");
                 regions.Add(region);
             }
             emptyDesignTimeHtml = base.GetDesignTimeHtml();
         }
         if (base.ViewInBrowseMode && (viewControl.ID != "AutoFormatPreviewControl"))
         {
             emptyDesignTimeHtml = base.CreatePlaceHolderDesignTimeHtml();
         }
     }
     catch (Exception exception)
     {
         emptyDesignTimeHtml = this.GetErrorDesignTimeHtml(exception);
     }
     return emptyDesignTimeHtml;
 }
Exemplo n.º 31
0
 public virtual string GetDesignTimeHtml(DesignerRegionCollection regions)
 {
     throw new NotImplementedException();
 }
 public ViewRendering(string content, DesignerRegionCollection regions) : this(content, regions, true)
 {
 }
 public ViewRendering(string content, DesignerRegionCollection regions, bool visible)
 {
     this._content = content;
     this._regions = regions;
     this._visible = visible;
 }
 public ViewRendering(string content, DesignerRegionCollection regions)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 35
0
        /// <summary>
        /// Retrieves the HTML markup to display the control and populates the collection with the current control designer regions.
        /// </summary>
        /// <param name="regions"></param>
        /// <returns>
        /// The design-time HTML markup for the associated control, including all control designer regions.
        /// </returns>
        public override String GetDesignTimeHtml(DesignerRegionCollection regions)
        {
            try
            {

                Grid grid = (Grid) Component;
                grid.m_EventRanDoRender = false;
                GridConfig.m_Site = grid.Site;

                string renderDesignTime = GridConfig.Get("WGDesignTime");
                if (!string.IsNullOrEmpty(renderDesignTime) && renderDesignTime.Equals("disabled"))
                    return "WebGrid - The plug and play grid";
                if (renderDesignTime == "notavailable")
                    return
                        "WebGrid - The plug and play grid<br/>Design-Time support is not available for this project. Please contact [email protected] for further help.";

                StringBuilder sb = new StringBuilder();
                StringWriter sw = new StringWriter(sb);
                HtmlTextWriter writer = new HtmlTextWriter(sw);
                grid.IsDesignTimeRender = true;
                grid.RenderControl(writer);
                grid.IsDesignTimeRender = false;
                if (string.IsNullOrEmpty(sb.ToString()))
                    if (string.IsNullOrEmpty(grid.MasterGrid) == false)
                        return string.Format("{0} slavegrid for '{1}'", grid.ID, grid.MasterGrid);
                return sb.ToString();
            }
            catch (Exception ee)
            {
                throw new GridException(string.Format("Error generating design time environment {0}", ee), ee);
            }
        }
Exemplo n.º 36
0
		public virtual string GetDesignTimeHtml (DesignerRegionCollection regions)
		{ throw new NotImplementedException (); }