protected override EditorPartCollection CreateEditorParts() { EditorPartCollection parts = new EditorPartCollection(); if (this._zoneTemplate != null) { Control container = new NonParentingControl(); this._zoneTemplate.InstantiateIn(container); if (!container.HasControls()) { return(parts); } foreach (Control control2 in container.Controls) { EditorPart part = control2 as EditorPart; if (part != null) { parts.Add(part); } else { LiteralControl control3 = control2 as LiteralControl; if (((control3 == null) || (control3.Text.Trim().Length != 0)) && !base.DesignMode) { throw new InvalidOperationException(System.Web.SR.GetString("EditorZone_OnlyEditorParts", new object[] { this.ID })); } } } } return(parts); }
private void Initialize(EditorPartCollection existingEditorParts, ICollection editorParts) { if (existingEditorParts != null) { foreach (EditorPart part in existingEditorParts) { base.InnerList.Add(part); } } if (editorParts != null) { foreach (object obj2 in editorParts) { if (obj2 == null) { throw new ArgumentException(System.Web.SR.GetString("Collection_CantAddNull"), "editorParts"); } if (!(obj2 is EditorPart)) { throw new ArgumentException(System.Web.SR.GetString("Collection_InvalidType", new object[] { "EditorPart" }), "editorParts"); } base.InnerList.Add(obj2); } } }
private void ApplyAndSyncChanges() { WebPart webPartToEdit = WebPartToEdit; Debug.Assert(webPartToEdit != null); if (webPartToEdit != null) { EditorPartCollection editorParts = EditorParts; foreach (EditorPart editorPart in editorParts) { if (editorPart.Display && editorPart.Visible && editorPart.ChromeState == PartChromeState.Normal) { if (!editorPart.ApplyChanges()) { _applyError = true; } } } if (!_applyError) { foreach (EditorPart editorPart in editorParts) { editorPart.SyncChanges(); } } } }
private void Initialize(EditorPartCollection existingEditorParts, ICollection editorParts) { if (existingEditorParts != null) { foreach (EditorPart existingEditorPart in existingEditorParts) { // Don't need to check arg, since we know it is valid since it came // from an EditorPartCollection. InnerList.Add(existingEditorPart); } } if (editorParts != null) { foreach (object obj in editorParts) { if (obj == null) { throw new ArgumentException(SR.GetString(SR.Collection_CantAddNull), "editorParts"); } if (!(obj is EditorPart)) { throw new ArgumentException(SR.GetString(SR.Collection_InvalidType, "EditorPart"), "editorParts"); } InnerList.Add(obj); } } }
protected override EditorPartCollection CreateEditorParts() { EditorPartCollection parts = new EditorPartCollection(); if (this._zoneTemplate != null) { Control container = new NonParentingControl(); this._zoneTemplate.InstantiateIn(container); if (!container.HasControls()) { return parts; } foreach (Control control2 in container.Controls) { EditorPart part = control2 as EditorPart; if (part != null) { parts.Add(part); } else { LiteralControl control3 = control2 as LiteralControl; if (((control3 == null) || (control3.Text.Trim().Length != 0)) && !base.DesignMode) { throw new InvalidOperationException(System.Web.SR.GetString("EditorZone_OnlyEditorParts", new object[] { this.ID })); } } } } return parts; }
protected override EditorPartCollection CreateEditorParts() { EditorPartCollection editorParts = new EditorPartCollection(); if (_zoneTemplate != null) { // PERF: Instantiate the template into a special control, that does nothing when a child control // is added. This is more performant because the child control is never parented to the temporary // control, it's ID is never generated, etc. Control container = new NonParentingControl(); _zoneTemplate.InstantiateIn(container); if (container.HasControls()) { foreach (Control control in container.Controls) { EditorPart part = control as EditorPart; if (part != null) { editorParts.Add(part); } else { LiteralControl literal = control as LiteralControl; // Throw an exception if it is *not* a literal containing only whitespace // Don't throw an exception in the designer, since we want only the offending // control to render as an error block, not the whole EditorZone. if (((literal == null) || (literal.Text.Trim().Length != 0)) && !DesignMode) { throw new InvalidOperationException(SR.GetString(SR.EditorZone_OnlyEditorParts, ID)); } } } } } return editorParts; }
public EditorPartCollection (EditorPartCollection existingEditorParts, ICollection editorParts) { foreach (object o in existingEditorParts) InnerList.Add (o); foreach (object o in editorParts) InnerList.Add (o); }
public override EditorPartCollection CreateEditorParts() { List<EditorPart> editorParts = new List<EditorPart>(); EditorPart editor = new MyCustomEditor(); editor.ID = ID + "_editor"; editor.Title = "List Selection"; editorParts.Add(editor); EditorPartCollection epc = new EditorPartCollection(editorParts); return epc; }
public override EditorPartCollection CreateEditorParts() { List<EditorPart> customEditorPartCollection = new List<EditorPart>(); ModuleEditorPart contentEditorPart = new ModuleEditorPart(); contentEditorPart.ID = "ContentEditorPart1"; customEditorPartCollection.Add(contentEditorPart); EditorPartCollection editorPartCollection = new EditorPartCollection(customEditorPartCollection); return editorPartCollection; }
public EditorPartCollection(EditorPartCollection existingEditorParts, ICollection editorParts) { foreach (object o in existingEditorParts) { InnerList.Add(o); } foreach (object o in editorParts) { InnerList.Add(o); } }
private void ApplyAndSyncChanges() { if (this.WebPartToEdit != null) { EditorPartCollection editorParts = this.EditorParts; foreach (EditorPart part2 in editorParts) { if ((part2.Display && part2.Visible) && ((part2.ChromeState == PartChromeState.Normal) && !part2.ApplyChanges())) { this._applyError = true; } } if (!this._applyError) { foreach (EditorPart part3 in editorParts) { part3.SyncChanges(); } } } }
protected override EditorPartCollection CreateEditorParts() { EditorPartCollection editorParts = new EditorPartCollection(); if (_zoneTemplate != null) { // PERF: Instantiate the template into a special control, that does nothing when a child control // is added. This is more performant because the child control is never parented to the temporary // control, it's ID is never generated, etc. Control container = new NonParentingControl(); _zoneTemplate.InstantiateIn(container); if (container.HasControls()) { foreach (Control control in container.Controls) { EditorPart part = control as EditorPart; if (part != null) { editorParts.Add(part); } else { LiteralControl literal = control as LiteralControl; // Throw an exception if it is *not* a literal containing only whitespace // Don't throw an exception in the designer, since we want only the offending // control to render as an error block, not the whole EditorZone. if (((literal == null) || (literal.Text.Trim().Length != 0)) && !DesignMode) { throw new InvalidOperationException(SR.GetString(SR.EditorZone_OnlyEditorParts, ID)); } } } } } return(editorParts); }
private void ApplyChanges(EditorPartCollection editors) { foreach (EditorPart part2 in editors) { if (!part2.Display) continue; if (!part2.Visible) continue; if (part2.ApplyChanges()) this._applyError = true; } }
private void SyncChanges(EditorPartCollection editorParts) { foreach (EditorPart part3 in editorParts) part3.SyncChanges(); }
public override EditorPartCollection CreateEditorParts() { ConfigPart tp = new ConfigPart(); tp.ID = this.ID + "ConnectionSettingsEditor"; tp.Title = "Connection Settings"; tp.ChromeState = PartChromeState.Normal; List<EditorPart> editors = new List<EditorPart>(); /*PropertyGridEditorPart tp = new PropertyGridEditorPart(); tp.ID = this.ID + "setting_editor"; tp.Title = "Connection Settings"; */ editors.Add(tp); EditorPartCollection result = new EditorPartCollection(editors); return result; }
public EditorPartCollection(EditorPartCollection existingEditorParts, ICollection editorParts) { Initialize(existingEditorParts, editorParts); }
// Called by a derived class if the list of EditorParts changes, and they want CreateEditorParts() // to be called again. protected void InvalidateEditorParts() { _editorParts = null; ChildControlsCreated = false; }
public override EditorPartCollection CreateEditorParts() { ArrayList editorArray = new ArrayList(); MyEditorPart edPart = new MyEditorPart(); edPart.ID = this.ID + "_editorPart1"; editorArray.Add(edPart); EditorPartCollection editorParts = new EditorPartCollection(editorArray); return editorParts; }
public override EditorPartCollection CreateEditorParts() { ArrayList editorArray = new ArrayList(); ViewEditorPart edPart = new ViewEditorPart(); edPart.ID = "ViewEditorPart1"; editorArray.Add(edPart); EditorPartCollection initEditorParts = base.CreateEditorParts(); EditorPartCollection editorParts = new EditorPartCollection(initEditorParts, editorArray); return editorParts; }
protected void InvalidateEditorParts() { this._editorParts = null; base.ChildControlsCreated = false; }
public override EditorPartCollection CreateEditorParts() { ArrayList editorArray = new ArrayList(); ListQueryFieldEditorPart edPart = new ListQueryFieldEditorPart(); edPart.ID = "ListFieldEditorPart1"; editorArray.Add(edPart); ListExportFieldEditorPart expPart = new ListExportFieldEditorPart(); expPart.ID = "ListFieldEditorPart2"; editorArray.Add(expPart); EditorPartCollection initEditorParts = base.CreateEditorParts(); EditorPartCollection editorParts = new EditorPartCollection(initEditorParts, editorArray); return editorParts; }
/// <summary> /// Called when a control enters edit display mode. It creates EditPart controls /// </summary> /// <returns>The collection of EditorPart controls</returns> public override EditorPartCollection CreateEditorParts() { ArrayList editorArray = new ArrayList(); PropertyImages edPart = new PropertyImages(); edPart.ID = this.ID + "_PropertyImages"; editorArray.Add(edPart); EditorPartCollection editorParts = new EditorPartCollection(editorArray); return editorParts; }
public EditorPartCollection(EditorPartCollection existingEditorParts, ICollection editorParts) { this.Initialize(existingEditorParts, editorParts); }
public override EditorPartCollection CreateEditorParts() { ArrayList editorArray = new ArrayList(); SkinEditorPart edPart = new SkinEditorPart(); edPart.ID = this.ID + "_skinEditorPart"; editorArray.Add(edPart); EditorPartCollection initEditorParts = base.CreateEditorParts(); EditorPartCollection editorParts = new EditorPartCollection(initEditorParts, editorArray); return editorParts; }