protected override void InsertInternal(int index, Element element) { if (!(element is SectionElement)) { throw new ArgumentException(); } base.InsertInternal(index, element); }
public VisualElementCollection(Element owner) : base(owner) { }
public void AddElement(Element element, string name) { if (this._currentSection == null) { throw new InvalidOperationException("No current panel"); } element.SetName(name); this._currentSection.Elements.Add(element); }
protected void AddElementInternal(Element element, string name) { this.EnsurePageCreationData(); this._data.AddElement(element, name); }
private void CollectNamedElements(Element parentElement) { ElementCollection elements = parentElement.Elements; if (elements.Count != 0) { foreach (Element element in elements) { if (element.Name != null) { this._namedElements[element.Name] = element; if (!(element is INameScopeElement)) { this.CollectNamedElements(element); } } } } }
protected virtual void InsertInternal(int index, Element element) { this.EnsureStorage(); if ((index < -1) || (index >= this._elements.Count)) { throw new ArgumentOutOfRangeException("index"); } if (element == null) { throw new ArgumentNullException("element"); } if (element.Parent != null) { element.Parent.Elements.Remove(element); } element.SetParent(this._owner); if (index == -1) { this._elements.Add(element); } else { this._elements.Insert(index, element); } if (element.Name != null) { this.DirtyNamedElements(); } this._owner.OnElementsChanged(); }
private void ApplyFormatting(Element element, bool applyFont) { if (applyFont) { FontStyle fontStyle = element.FontStyle; if (this._boldCount != 0) { fontStyle |= FontStyle.Bold; } if (this._italicCount != 0) { fontStyle |= FontStyle.Italic; } if (this._strikeoutCount != 0) { fontStyle |= FontStyle.Strikeout; } if (this._underlineCount != 0) { fontStyle |= FontStyle.Underline; } element.FontStyle = fontStyle; if ((this._fontSizeStack != null) && (this._fontSizeStack.Count != 0)) { element.FontSize = (float) this._fontSizeStack.Peek(); } if ((this._fontFamilyStack != null) && (this._fontFamilyStack.Count != 0)) { element.FontFamily = (string) this._fontFamilyStack.Peek(); } } if ((this._foreColorStack != null) && (this._foreColorStack.Count != 0)) { element.ForeColor = (Color) this._foreColorStack.Peek(); } if ((this._backColorStack != null) && (this._backColorStack.Count != 0)) { element.BackColor = (Color) this._backColorStack.Peek(); } }
public EmptyElementCollection(Element owner) : base(owner) { }
public int IndexOf(Element element) { if ((element != null) && (this._elements != null)) { int count = this.Count; for (int i = 0; i < count; i++) { if (this[i] == element) { return i; } } } return -1; }
public ElementCollection(Element owner) { this._owner = owner; }
public bool Contains(Element element) { if (this._elements == null) { return false; } return (this.IndexOf(element) != -1); }
public void Add(Element element) { this.InsertInternal(-1, element); }
private void RaiseElementClickEvent(Element element) { ElementEventArgs e = new ElementEventArgs(element); if (this._page.RaiseElementClickEvent(e)) { this.OnElementClick(e); } }
public void AddElement(Element element, string name) { this.AddElement(element, name, true); }
public void AddElement(Element element) { this.AddElement(element, null, true); }
internal void SetParent(Element parent) { this._parent = parent; this._nameScope = null; }
public void Insert(int index, Element element) { this.InsertInternal(index, element); }
public void Remove(Element element) { if (element == null) { throw new ArgumentNullException("element"); } int index = this.IndexOf(element); if (index == -1) { throw new ArgumentException(); } this.RemoveAt(index); }
protected virtual void GenerateDocumentation(Element documentationContainer) { TextElement element = new TextElement("[Doc-comment support is not yet implemented.]"); element.ForeColor = Color.Gray; documentationContainer.Elements.Add(element); }
protected void AddElement(Element element, string name, bool applyFont) { this.ApplyFormatting(element, applyFont); base.AddElementInternal(element, name); }