public virtual void OnNodeAfterSelection(TreeViewEventArgs e) { HtmlElement_Base he = HtmlElement; Guid guid = Guid.Empty; if (string.CompareOrdinal(he.tagName, "body") != 0) { if (he.ElementGuid != Guid.Empty) { guid = he.ElementGuid; } } if (guid != Guid.Empty) { TreeViewObjectExplorer tv = this.TreeView as TreeViewObjectExplorer; if (tv != null) { TreeNodeClassRoot r = tv.RootClassNode; if (r != null && r.ClassData.DesignerHolder != null) { r.ClassData.DesignerHolder.OnSelectedHtmlElement(guid, tv); } } } }
public void OnSelectHtmlElement(HtmlElement_Base he) { this.ClassPointer = he; OnSetImage(); base.SetLabelText(string.Format(CultureInfo.InvariantCulture, "current element:{0}", he.ToString())); this.Refresh(); }
public override void OnWriteToXmlNode(IXmlCodeWriter writer, XmlNode node) { base.OnWriteToXmlNode(writer, node); HtmlElement_Base he = this.ClassPointer as HtmlElement_Base; if (he != null) { XmlUtil.SetAttribute(node, XmlTags.XMLATT_guid, he.ElementGuidString); } }
protected override void OnSelectByMouseDown() { base.OnSelectByMouseDown(); HtmlElement_Base heb = this.HtmlElement; if (heb != null) { DesignerPane.OnSelectedHtmlElement(heb.ElementGuid, this.Parent); } }
public override bool OnDeserialize(ClassPointer root, ILimnorDesigner designer) { HtmlElement_Base c = this.HtmlElement; if (c == null) { c = new HtmlElement_body(root); } Init(designer, c); return(true); }
public override void SetLabelText(string name) { HtmlElement_Base heb = this.ClassPointer as HtmlElement_Base; if (heb != null) { base.SetLabelText(string.Format(CultureInfo.InvariantCulture, "current element:{0}", heb.ToString())); } else { base.SetLabelText("current element:"); } }
public override void LoadNextLevel(TreeViewObjectExplorer tv, TreeNodeObject parentNode) { UInt32 scopeId = parentNode.ScopeMethodId; HtmlElement_Base objRef = (HtmlElement_Base)parentNode.OwnerIdentity; parentNode.Nodes.Add(new TreeNodeHtmlPropertyCollection(tv, parentNode, objRef, scopeId)); if (parentNode.SelectionTarget == EnumObjectSelectType.All || parentNode.SelectionTarget == EnumObjectSelectType.Event || !string.IsNullOrEmpty(parentNode.EventScope)) { parentNode.Nodes.Add(new TreeNodeHtmlEventCollection(tv, parentNode, objRef, scopeId)); } if (parentNode.SelectionTarget == EnumObjectSelectType.All || parentNode.SelectionTarget == EnumObjectSelectType.Method || parentNode.SelectionTarget == EnumObjectSelectType.Action || parentNode.SelectionTarget == EnumObjectSelectType.Object) { parentNode.Nodes.Add(new TreeNodeHtmlMethodCollection(tv, parentNode, objRef, scopeId)); } }
public override void OnReadFromXmlNode(IXmlCodeReader reader, XmlNode node) { base.OnReadFromXmlNode(reader, node); string guid = XmlUtil.GetAttribute(node, XmlTags.XMLATT_guid); XmlObjectReader xr = reader as XmlObjectReader; ClassPointer root = xr.ObjectList.RootPointer as ClassPointer; HtmlElement_Base he = null; if (!string.IsNullOrEmpty(guid)) { he = root.FindHtmlElementByGuid(new Guid(guid)); } if (he == null) { he = new HtmlElement_body(root); } this.ClassPointer = he; }
public static int GetHtmlElementIcon(HtmlElement_Base he) { string webFolder = he.WebPhysicalFolder; int n; string imgKey = he.ImageKey; if (imgList == null) { imgList = new Dictionary <string, int>(); } if (imgList.TryGetValue(imgKey, out n)) { return(n); } Image img = he.ImageIcon; n = TreeViewObjectExplorer.ObjectImageList.Images.Add(img, Color.White); imgList.Add(imgKey, n); return(n); }
public TreeNodeHtmlMethodCollection(TreeViewObjectExplorer tv, TreeNodeObject parentNode, HtmlElement_Base objectPointer, UInt32 scopeMethodId) : base(tv, parentNode, false, objectPointer, scopeMethodId) { Text = "Methods inherited"; Nodes.Add(new HtmlMethodLoader()); }
private int getTreeIcon() { HtmlElement_Base heb = HtmlElement; return(GetHtmlElementIcon(heb)); }
public TreeNodeHtmlEventCollection(TreeViewObjectExplorer tv, TreeNodeObject parentNode, HtmlElement_Base objectPointer, UInt32 scopeMethodId) : base(tv, parentNode, false, objectPointer, scopeMethodId) { Text = "Events inherited"; }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (context != null && context.Instance != null && provider != null) { IWindowsFormsEditorService service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (service != null) { string title = null; string filter = null; FilePathAttribute fa = null; if (context.PropertyDescriptor.Attributes != null) { foreach (Attribute a in context.PropertyDescriptor.Attributes) { fa = a as FilePathAttribute; if (fa != null) { title = fa.Title; filter = fa.Pattern; break; } } } if (string.IsNullOrEmpty(title)) { title = "Select web file"; filter = "All files|*.*"; } ParameterValue pv = context.Instance as ParameterValue; if (pv != null) { OpenFileDialog dlg = new OpenFileDialog(); if (value != null) { dlg.FileName = value.ToString(); } dlg.Title = title; dlg.Filter = filter; if (dlg.ShowDialog() == DialogResult.OK) { value = dlg.FileName; } } else { HtmlElement_Base heb = context.Instance as HtmlElement_Base; if (heb != null) { try { //the dialog will copy the selected file to web folder DialogHtmlFile dlg = new DialogHtmlFile(); dlg.LoadData(heb.WebPhysicalFolder, value as string, title, filter); if (service.ShowDialog(dlg) == DialogResult.OK) { HtmlElement_object hob = heb as HtmlElement_object; if (hob != null && string.CompareOrdinal(context.PropertyDescriptor.Name, "archive") == 0) { hob.AppendArchiveFile(hob.id, dlg.WebFile); } else { heb.SetWebProperty(context.PropertyDescriptor.Name, dlg.WebFile); value = dlg.WebFile; } } } catch (Exception err) { MessageBox.Show(err.Message); } } } } } return(value); }
public void SelectHtmlElementByGuid(Guid guid) { webBrowser1.Document.InvokeScript("setSelectedObject", new object[] { HtmlElement_Base.GetGuidString(guid) }); }
public void SwitchHtmlElement(HtmlElement_Base element) { this.ResetObjectPointer(element); this.ResetNextLevel(this.TreeView as TreeViewObjectExplorer); }
public override bool IsSameElement(HtmlElement_Base e) { HtmlElement_body bd = e as HtmlElement_body; return(bd != null); }
public void OnHtmlElementSelected(HtmlElement_Base element) { }
public void SelectHtmlElementByGuid(Guid guid) { ExecuteJs("setSelectedObject('{0}');", HtmlElement_Base.GetGuidString(guid)); }
public void OnHtmlElementSelected(HtmlElement_Base element) { _objExplorer.OnHtmlElementSelected(element); }
public void OnHtmlElementSelected(HtmlElement_Base element) { _eventPath.OnHtmlElementSelected(element); }