コード例 #1
0
        public override Control GetPreviewControl(Control runtimeControl)
        {
            CatalogZone previewControl = (CatalogZone)base.GetPreviewControl(runtimeControl);

            if ((previewControl != null) && (previewControl.CatalogParts.Count == 0))
            {
                previewControl.ZoneTemplate = new AutoFormatTemplate();
            }
            previewControl.ID = "AutoFormatPreviewControl";
            return(previewControl);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public DesignerCatalogPartChrome(CatalogZone zone) : base(zone)
 {
 }
コード例 #4
0
 public override void Initialize(IComponent component)
 {
     ControlDesigner.VerifyInitializeArgument(component, typeof(CatalogZone));
     base.Initialize(component);
     this._zone = (CatalogZone)component;
 }
コード例 #5
0
 public CatalogPartEditableDesignerRegion(CatalogZone zone, TemplateDefinition templateDefinition) : base(templateDefinition)
 {
     this._zone = zone;
 }