public static string LocalizeControl(Control control, IDesignTimeResourceWriter resourceWriter, out string newInnerContent) { if (control == null) { throw new ArgumentNullException("control"); } if (resourceWriter == null) { throw new ArgumentNullException("resourceWriter"); } if (control.Site == null) { throw new InvalidOperationException(); } IDesignerHost service = (IDesignerHost)control.Site.GetService(typeof(IDesignerHost)); IDesignerHost parseTimeDesignerHost = new LocalizationDesignerHost(service); Control control2 = (service.GetDesigner(control) as ControlDesigner).CreateClonedControl(parseTimeDesignerHost, false); ((IControlDesignerAccessor)control2).SetOwnerControl(control); bool shouldLocalizeInnerContent = ShouldLocalizeInnerContents(control.Site, control); string str = LocalizeControl(control2, parseTimeDesignerHost, resourceWriter, shouldLocalizeInnerContent); if (shouldLocalizeInnerContent) { newInnerContent = ControlSerializer.SerializeInnerContents(control2, parseTimeDesignerHost); return(str); } newInnerContent = null; return(str); }
public static ITemplate ParseTemplate(IDesignerHost designerHost, string templateText, string directives) { if (designerHost == null) { throw new ArgumentNullException("designerHost"); } return(ControlSerializer.DeserializeTemplate(templateText, designerHost)); }
public static Control[] ParseControls(IDesignerHost designerHost, string controlText) { if (designerHost == null) { throw new ArgumentNullException("designerHost"); } if ((controlText == null) || (controlText.Length == 0)) { throw new ArgumentNullException("controlText"); } return(ControlSerializer.DeserializeControls(controlText, designerHost)); }
internal static Control ParseControl(IDesignerHost designerHost, string controlText, bool applyTheme) { if (designerHost == null) { throw new ArgumentNullException("designerHost"); } if ((controlText == null) || (controlText.Length == 0)) { throw new ArgumentNullException("controlText"); } return(ControlSerializer.DeserializeControlInternal(controlText, designerHost, applyTheme)); }
public static Control ParseControl(IDesignerHost designerHost, string controlText, string directives) { if (designerHost == null) { throw new ArgumentNullException("designerHost"); } if ((controlText == null) || (controlText.Length == 0)) { throw new ArgumentNullException("controlText"); } if ((directives != null) && (directives.Length != 0)) { controlText = directives + controlText; } return(ControlSerializer.DeserializeControl(controlText, designerHost)); }
public static void PersistTemplate(TextWriter writer, ITemplate template, IDesignerHost host) { ControlSerializer.SerializeTemplate(template, writer, host); }
public static string PersistTemplate(ITemplate template, IDesignerHost host) { return(ControlSerializer.SerializeTemplate(template, host)); }
public static void PersistInnerProperties(TextWriter sw, object component, IDesignerHost host) { ControlSerializer.SerializeInnerProperties(component, host, sw); }
public static string PersistInnerProperties(object component, IDesignerHost host) { return(ControlSerializer.SerializeInnerProperties(component, host)); }
public static void PersistControl(TextWriter sw, Control control, IDesignerHost host) { ControlSerializer.SerializeControl(control, host, sw); }
public static string PersistControl(Control control, IDesignerHost host) { return(ControlSerializer.SerializeControl(control, host)); }
public static void PersistControl(TextWriter sw, Control control) { ControlSerializer.SerializeControl(control, sw); }
public static string PersistControl(Control control) { return(ControlSerializer.SerializeControl(control)); }