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);
        }
예제 #2
0
 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);
         }
     }
 }
예제 #3
0
        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();
                    }
                }
            }
        }
예제 #4
0
        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;
 }
예제 #6
0
        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;
        }
예제 #7
0
		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;
 }
예제 #9
0
        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;
        }
예제 #10
0
 public EditorPartCollection(EditorPartCollection existingEditorParts,
                             ICollection editorParts)
 {
     foreach (object o in existingEditorParts)
     {
         InnerList.Add(o);
     }
     foreach (object o in editorParts)
     {
         InnerList.Add(o);
     }
 }
        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);
                }
            }
        }
예제 #12
0
 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();
             }
         }
     }
 }
예제 #13
0
        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);
        }
예제 #14
0
 private void ApplyChanges(EditorPartCollection editors)
 {
     foreach (EditorPart part2 in editors)
     {
         if (!part2.Display) continue;
         if (!part2.Visible) continue;
         if (part2.ApplyChanges())
             this._applyError = true;                
     }
 }
예제 #15
0
 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);
 }
예제 #18
0
 // 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;
 }
예제 #19
0
 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;
 }
예제 #20
0
 // 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;
 }
예제 #21
0
        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;
 }
예제 #23
0
 protected void InvalidateEditorParts()
 {
     this._editorParts         = null;
     base.ChildControlsCreated = false;
 }
예제 #24
0
        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;
        }
예제 #25
0
 /// <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;
 }
예제 #26
0
 public EditorPartCollection(EditorPartCollection existingEditorParts, ICollection editorParts)
 {
     this.Initialize(existingEditorParts, editorParts);
 }
예제 #27
0
        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;
        }