protected override void OnSelectedIndexChanged(EventArgs e) { base.OnSelectedIndexChanged(e); if (!_selecting) { if (SelectedObject != null) { if (this.SelectedIndex > 0) { ComponentDataDisplay s = this.Items[this.SelectedIndex] as ComponentDataDisplay; if (s != null) { EventArgsObjectSelection ev = new EventArgsObjectSelection(s); SelectedObject(this, ev); } else { HtmlElement_BodyBase heb = this.Items[this.SelectedIndex] as HtmlElement_BodyBase; if (heb != null) { EventArgsHtmlElementSelection eh = new EventArgsHtmlElementSelection(heb); SelectedObject(this, eh); } } } } } }
public void SelectByName(string name) { bool found = false; if (!string.IsNullOrEmpty(name)) { for (int i = 0; i < this.Items.Count; i++) { ComponentDataDisplay s = this.Items[i] as ComponentDataDisplay; if (s != null) { if (string.CompareOrdinal(s.Name, name) == 0) { found = true; _selecting = true; this.SelectedIndex = i; _selecting = false; break; } } } } if (!found) { this.SelectedIndex = 0; } }
public void ReloadClassPointer() { this.Items.Clear(); if (_root != null) { ComponentDataDisplay s = getComponentDisplay(_root.ObjectInstance as IComponent, 1); if (s != null) { this.Items.Add(new ComponentDataDisplay(null, string.Empty, 0, string.Empty)); this.Items.Add(s); if (_root.ObjectList != null) { foreach (KeyValuePair <object, UInt32> kv in _root.ObjectList) { if (kv.Key != _root.ObjectInstance) { s = getComponentDisplay(kv.Key as IComponent, kv.Value); if (s != null) { this.Items.Add(s); } } } } if (_root.IsWebPage) { IList <HtmlElement_BodyBase> lst = _root.UsedHtmlElements; if (lst != null && lst.Count > 0) { for (int i = 0; i < lst.Count; i++) { this.Items.Add(lst[i]); } } } _selecting = true; this.SelectedIndex = 1; _selecting = false; } } }
public EventArgsObjectSelection(ComponentDataDisplay obj) { _obj = obj; }