/// <summary> /// initialize fields based on input node. /// </summary> /// <param name="mdc"></param> /// <param name="input"></param> protected virtual void InitMemberVariablesFromInput(IFwMetaDataCache mdc, XmlNode input) { m_className = XmlUtils.GetManditoryAttributeValue(input, "class"); m_clsid = mdc.GetClassId(m_className); m_fieldType = XmlUtils.GetManditoryAttributeValue(input, "fieldType"); m_restrictions = XmlUtils.GetOptionalAttributeValue(input, "restrictions", "none"); m_source = XmlUtils.GetFirstNonCommentChild(input); }
/// <summary> /// initialize fields based on input node. /// </summary> /// <param name="mdc"></param> /// <param name="input"></param> protected virtual void InitMemberVariablesFromInput(IFwMetaDataCache mdc, XmlNode input) { m_className = XmlUtils.GetManditoryAttributeValue(input, "class"); m_clsid = mdc.GetClassId(m_className); m_fieldType = XmlUtils.GetManditoryAttributeValue(input, "fieldType"); m_restrictions = XmlUtils.GetOptionalAttributeValue(input, "restrictions", "none"); m_source = XmlUtils.GetFirstNonCommentChild(input); }
private int LoadCmObjectProperties(XmlNode objectNode, int owner, int owningFlid, int ord, out int clid, IDictionary <int, int> objects) { var hvo = m_realDataCache.NextHvo; clid = m_metaDataCache.GetClassId(objectNode.Name); objects.Add(hvo, clid); m_realDataCache.CacheIntProp(hvo, (int)CmObjectFields.kflidCmObject_Class, clid); var id = objectNode.Attributes["id"].Value.Substring(1); m_realDataCache.CacheGuidProp(hvo, (int)CmObjectFields.kflidCmObject_Guid, new Guid(id)); if (owner > 0) { m_realDataCache.CacheObjProp(hvo, (int)CmObjectFields.kflidCmObject_Owner, owner); } m_realDataCache.CacheIntProp(hvo, (int)CmObjectFields.kflidCmObject_OwnFlid, owningFlid); m_realDataCache.CacheIntProp(hvo, (int)CmObjectFields.kflidCmObject_OwnOrd, ord); // Maybe need to cache the two other CmObject columns (UpdStmp and UpdDttm) return(hvo); }
int MakeObject(XmlNode elt) { string className = elt.Name; int clid = m_mdc.GetClassId(className); if (clid == 0) { throw new Exception("class not found " + className); } int hvo = GetId(elt); m_cda.CacheIntProp(hvo, (int)CmObjectFields.kflidCmObject_Class, (int)clid); foreach (XmlNode child in elt.ChildNodes) { if (child is XmlComment) { continue; } switch (child.Name) { case "seq": AddOwningSeqProp(hvo, child); break; case "ms": AddMultiStringProp(hvo, child); break; case "obj": AddOwningAtomicProp(hvo, child); break; default: throw new Exception("unexpected element " + child.Name + " found in " + className); } } return(hvo); }
// public static int GetFlid(IFwMetaDataCache mdc, string stClassName, string stFieldName) { int clsid = (int)mdc.GetClassId(stClassName); return(GetFlid(mdc, clsid, stFieldName)); }
// public static int GetFlid(IFwMetaDataCache mdc, string stClassName, string stFieldName) { int clsid = (int) mdc.GetClassId(stClassName); return GetFlid(mdc, clsid, stFieldName); }
/// <summary> /// A rather inefficient way of finding the ID of the class that has a particular name. /// IFwMetaDataCache should be enhanced to provide this efficiently. /// </summary> /// <param name="mdc"></param> /// <param name="stClassName"></param> /// <returns>ClassId, or 0 if not found.</returns> public static int GetClassId(IFwMetaDataCache mdc, string stClassName) { return (int)mdc.GetClassId(stClassName); }