當前位置: 首頁>>代碼示例>>C#>>正文


C# XmlElement.WithAtt方法代碼示例

本文整理匯總了C#中System.Xml.XmlElement.WithAtt方法的典型用法代碼示例。如果您正苦於以下問題:C# XmlElement.WithAtt方法的具體用法?C# XmlElement.WithAtt怎麽用?C# XmlElement.WithAtt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Xml.XmlElement的用法示例。


在下文中一共展示了XmlElement.WithAtt方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: WriteBaseCollectionAttributes

        protected void WriteBaseCollectionAttributes(XmlElement element, ICollectionMapping mapping)
        {
            if (mapping.HasValue(x => x.Access))
                element.WithAtt("access", mapping.Access);

            if (mapping.HasValue(x => x.BatchSize))
                element.WithAtt("batch-size", mapping.BatchSize);

            if (mapping.HasValue(x => x.Cascade))
                element.WithAtt("cascade", mapping.Cascade);

            if (mapping.HasValue(x => x.Check))
                element.WithAtt("check", mapping.Check);

            if (mapping.HasValue(x => x.CollectionType))
                element.WithAtt("collection-type", mapping.CollectionType);

            if (mapping.HasValue(x => x.Fetch))
                element.WithAtt("fetch", mapping.Fetch);

            if (mapping.HasValue(x => x.Generic))
                element.WithAtt("generic", mapping.Generic);

            if (mapping.HasValue(x => x.Inverse))
                element.WithAtt("inverse", mapping.Inverse);

            if (mapping.HasValue(x => x.Lazy))
                element.WithAtt("lazy", mapping.Lazy);

            if (mapping.HasValue(x => x.Name))
                element.WithAtt("name", mapping.Name);

            if (mapping.HasValue(x => x.OptimisticLock))
                element.WithAtt("optimistic-lock", mapping.OptimisticLock);

            if (mapping.HasValue(x => x.Persister))
                element.WithAtt("persister", mapping.Persister);

            if (mapping.HasValue(x => x.Schema))
                element.WithAtt("schema", mapping.Schema);

            if (mapping.HasValue(x => x.TableName))
                element.WithAtt("table", mapping.TableName);

            if (mapping.HasValue(x => x.Where))
                element.WithAtt("where", mapping.Where);

            if (mapping.HasValue(x => x.Subselect))
                element.WithAtt("subselect", mapping.Subselect);

            if (mapping.HasValue(x => x.Mutable))
                element.WithAtt("mutable", mapping.Mutable);
        }
開發者ID:roend83,項目名稱:fluent-nhibernate,代碼行數:53,代碼來源:CollectionAttributeWriter.cs

示例2: WriteBaseCollectionAttributes

        protected void WriteBaseCollectionAttributes(XmlElement element, CollectionMapping mapping)
        {
            if (mapping.IsSpecified("Access"))
                element.WithAtt("access", mapping.Access);

            if (mapping.IsSpecified("BatchSize"))
                element.WithAtt("batch-size", mapping.BatchSize);

            if (mapping.IsSpecified("Cascade"))
                element.WithAtt("cascade", mapping.Cascade);

            if (mapping.IsSpecified("Check"))
                element.WithAtt("check", mapping.Check);

            if (mapping.IsSpecified("CollectionType") && mapping.CollectionType != TypeReference.Empty)
                element.WithAtt("collection-type", mapping.CollectionType);

            if (mapping.IsSpecified("Fetch"))
                element.WithAtt("fetch", mapping.Fetch);

            if (mapping.IsSpecified("Generic"))
                element.WithAtt("generic", mapping.Generic);

            if (mapping.IsSpecified("Inverse"))
                element.WithAtt("inverse", mapping.Inverse);

            if (mapping.IsSpecified("Lazy"))
                element.WithAtt("lazy", mapping.Lazy.ToString().ToLowerInvariant());

            if (mapping.IsSpecified("Name"))
                element.WithAtt("name", mapping.Name);

            if (mapping.IsSpecified("OptimisticLock"))
                element.WithAtt("optimistic-lock", mapping.OptimisticLock);

            if (mapping.IsSpecified("Persister"))
                element.WithAtt("persister", mapping.Persister);

            if (mapping.IsSpecified("Schema"))
                element.WithAtt("schema", mapping.Schema);

            if (mapping.IsSpecified("TableName"))
                element.WithAtt("table", mapping.TableName);

            if (mapping.IsSpecified("Where"))
                element.WithAtt("where", mapping.Where);

            if (mapping.IsSpecified("Subselect"))
                element.WithAtt("subselect", mapping.Subselect);

            if (mapping.IsSpecified("Mutable"))
                element.WithAtt("mutable", mapping.Mutable);
        }
開發者ID:akhuang,項目名稱:NHibernateTest,代碼行數:53,代碼來源:CollectionAttributeWriter.cs


注:本文中的System.Xml.XmlElement.WithAtt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。