本文整理汇总了C#中IPropertyMap.GetDocElement方法的典型用法代码示例。如果您正苦于以下问题:C# IPropertyMap.GetDocElement方法的具体用法?C# IPropertyMap.GetDocElement怎么用?C# IPropertyMap.GetDocElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertyMap
的用法示例。
在下文中一共展示了IPropertyMap.GetDocElement方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeserializeInlineReferenceList
protected virtual void DeserializeInlineReferenceList(object obj, IClassMap classMap, IPropertyMap propertyMap, XmlNode xmlObject)
{
IObjectManager om = this.Context.ObjectManager;
IListManager lm = this.Context.ListManager ;
XmlNode xmlList = xmlObject.SelectSingleNode(propertyMap.GetDocElement());
IList list = (IList) om.GetPropertyValue(obj, propertyMap.Name);
if (list == null)
{
list = lm.CreateList(obj, propertyMap) ;
om.SetPropertyValue(obj,propertyMap.Name,list) ;
//IList cloneList = lm.CloneList(obj, propertyMap, list);
IList cloneList = new ArrayList( list);
om.SetOriginalPropertyValue(obj, propertyMap.Name, cloneList);
}
IInterceptableList mList;
bool stackMute = false;
mList = list as IInterceptableList;
if (mList != null)
{
stackMute = mList.MuteNotify;
mList.MuteNotify = true;
}
foreach(XmlNode xmlItem in xmlList.SelectNodes("item"))
{
object value = ManageInlineReference(xmlObject, obj, xmlItem);;
if (value != null)
list.Add(value);
}
IList clone = new ArrayList( list);
if (mList != null)
mList.MuteNotify = stackMute ;
om.SetNullValueStatus(obj, propertyMap.Name, false);
//IList clone = lm.CloneList(obj, propertyMap, list);
om.SetOriginalPropertyValue(obj, propertyMap.Name, clone);
}
示例2: DeserializeInlineReference
protected virtual void DeserializeInlineReference(object obj, IClassMap classMap, IPropertyMap propertyMap, XmlNode xmlObject)
{
IObjectManager om = this.Context.ObjectManager;
bool isNull = false;
XmlNode xmlRef = xmlObject.SelectSingleNode(propertyMap.GetDocElement());
object value = ManageInlineReference(xmlObject, obj, xmlRef);;
if (value == null)
isNull = true;
om.SetNullValueStatus(obj, propertyMap.Name, isNull);
om.SetPropertyValue(obj, propertyMap.Name, value);
om.SetOriginalPropertyValue(obj, propertyMap.Name, value);
}
示例3: SerializeInlineReference
protected virtual void SerializeInlineReference(XmlNode xmlObject, object obj, IClassMap classMap, IPropertyMap propertyMap, bool creating)
{
IObjectManager om = this.Context.ObjectManager;
object value = null ;
bool isNull = om.GetNullValueStatus(obj, propertyMap.Name);
if (!(isNull))
{
value = om.GetPropertyValue(obj, propertyMap.Name) ;
if (value == null)
isNull = true;
}
//Optimistic concurrency
if (!(creating))
{
//Check value in xmlDoc against property original value, make sure they match
}
if (isNull)
{
om.SetOriginalPropertyValue(obj, propertyMap.Name, System.DBNull.Value);
RemoveNode(xmlObject, propertyMap.GetDocElement() );
}
else
{
om.SetOriginalPropertyValue(obj, propertyMap.Name, value);
SerializeInlineReferenceElement(obj, GetNode(xmlObject, propertyMap.GetDocElement()), value);
}
}
示例4: SerializeInlineReferenceList
protected virtual void SerializeInlineReferenceList(XmlNode xmlObject, object obj, IClassMap classMap, IPropertyMap propertyMap, bool creating)
{
IObjectManager om = this.Context.ObjectManager;
IListManager lm = this.Context.ListManager;
IList list = (IList) om.GetPropertyValue(obj, propertyMap.Name) ;
//Optimistic concurrency
if (!(creating))
{
//Check value in xmlDoc against property original value, make sure they match
}
XmlNode xmlList = GetNode(xmlObject, propertyMap.GetDocElement());
RemoveAllChildNodes(xmlList);
foreach (object value in list)
{
XmlNode xmlElement = AddNode(xmlList, "item");
SerializeInlineReferenceElement(obj, xmlElement, value);
}
//IList orgList = lm.CloneList(obj, propertyMap, ((IList) (om.GetPropertyValue(obj, propertyMap.Name))));
IList orgList = new ArrayList( ((IList) (om.GetPropertyValue(obj, propertyMap.Name))));
om.SetOriginalPropertyValue(obj, propertyMap.Name, orgList);
}
示例5: SerializeInlineObjectList
protected virtual void SerializeInlineObjectList(XmlNode xmlObject, object obj, IClassMap classMap, IPropertyMap propertyMap, bool creating)
{
IObjectManager om = this.Context.ObjectManager;
IListManager lm = this.Context.ListManager;
IList list = (IList) om.GetPropertyValue(obj, propertyMap.Name) ;
XmlNode xmlList = GetNode(xmlObject, propertyMap.GetDocElement());
RemoveAllChildNodes(xmlList);
foreach (object value in list)
{
XmlNode xmlInline = AddNode(xmlObject, "item");
SerializeInlineObjectElement(xmlObject, obj, xmlInline , value, creating);
}
//IList orgList = lm.CloneList(obj, propertyMap, ((IList) (om.GetPropertyValue(obj, propertyMap.Name))));
IList orgList = new ArrayList( ((IList) (om.GetPropertyValue(obj, propertyMap.Name))));
om.SetOriginalPropertyValue(obj, propertyMap.Name, orgList);
}