当前位置: 首页>>代码示例>>C#>>正文


C# IPropertyMap.GetDocElement方法代码示例

本文整理汇总了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);
        }
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:44,代码来源:DocumentPersistenceEngine.cs

示例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);
        }
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:16,代码来源:DocumentPersistenceEngine.cs

示例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);
            }
        }
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:31,代码来源:DocumentPersistenceEngine.cs

示例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);
        }
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:28,代码来源:DocumentPersistenceEngine.cs

示例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);
        }
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:20,代码来源:DocumentPersistenceEngine.cs


注:本文中的IPropertyMap.GetDocElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。