public LimnorContextMenuCollection GetObjectMenuData(object obj) { LimnorXmlDesignerLoader2 l = this.Loader as LimnorXmlDesignerLoader2; UInt32 id = l.ObjectMap.GetObjectID(obj); if (_menuData == null) { _menuData = new Dictionary <UInt32, LimnorContextMenuCollection>(); } LimnorContextMenuCollection data; if (!_menuData.TryGetValue(id, out data)) { if (obj == l.RootObject) { data = new LimnorContextMenuCollection(l.GetRootId()); } else { MemberComponentId mc = MemberComponentId.CreateMemberComponentId(l.GetRootId(), obj, id, null); data = new LimnorContextMenuCollection(mc); } _menuData.Add(id, data); } return(data); }
public void OnBeforeRead(XmlObjectReader reader, XmlNode node) { _reader = reader; _xmlNode = node; ScopeMethodId = XmlUtil.GetAttributeUInt(node, XmlTags.XMLATT_ScopeId); SubScopeId = XmlUtil.GetAttributeUInt(node, XmlTags.XMLATT_SubScopeId); _varId = XmlUtil.GetAttributeUInt(node, XmlTags.XMLATT_ComponentID); //load DataTypePointer from ComponentIconLocal ClassPointer root = reader.ObjectList.GetTypedData <ClassPointer>(); _var = MemberComponentId.CreateMemberComponentId(root, root.ObjectList.GetObjectByID(_varId), _varId, null); adjustParamType(); }
public override void OnPostSerialize(ObjectIDmap objMap, XmlNode objectNode, bool saved, object serializer) { if (saved) { } else { if (MemberId == objMap.MemberId) { ClassPointer = objMap.GetTypedData <ClassPointer>(); } else { ClassInstancePointer cr = DesignUtil.GetClassRef(WholeId, objMap); if (cr != null) { ClassPointer = cr; } else { object v = objMap.GetObjectByID(MemberId); if (v == null) { if (objMap.Count == 0) { } else { if (MemberId == 3667767822) { //it is the HtmlElement_body } else { //this time the object may not be available. } } } else { MemberComponentId mc = MemberComponentId.CreateMemberComponentId(objMap.GetTypedData <ClassPointer>(), v, MemberId, null); ClassPointer = mc; } } } } }