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


C# NodeIndex.GetElementsByName方法代码示例

本文整理汇总了C#中HandCoded.Xml.NodeIndex.GetElementsByName方法的典型用法代码示例。如果您正苦于以下问题:C# NodeIndex.GetElementsByName方法的具体用法?C# NodeIndex.GetElementsByName怎么用?C# NodeIndex.GetElementsByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HandCoded.Xml.NodeIndex的用法示例。


在下文中一共展示了NodeIndex.GetElementsByName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Evaluate

        /// <summary>
        /// Evaluates this <see cref="Precondition"/> against the contents of the
        /// indicated <see cref="NodeIndex"/>.
        /// </summary>
        /// <param name="nodeIndex">The <see cref="NodeIndex"/> of a <see cref="XmlDocument"/>.</param>
        /// <param name="cache">A cache of previously evaluated precondition results.</param>
        /// <returns>A <see cref="bool"/> value indicating the applicability of this
        /// <see cref="Precondition"/> to the <see cref="XmlDocument"/>.</returns>
        public override bool Evaluate(NodeIndex nodeIndex, Dictionary<Precondition, bool> cache)
        {
            foreach (string rootElement in release.RootElements) {
                XmlNodeList list = nodeIndex.GetElementsByName (rootElement);

                if (list.Count == 1) {
                    XmlElement	fpml = list [0] as XmlElement;

                    if (fpml.LocalName.Equals("FpML"))
                        return (fpml.GetAttribute ("version").Equals (release.Version));
                    else
                        return (fpml.GetAttribute ("fpmlVersion").Equals (release.Version));
                }
            }
            return (false);
        }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:24,代码来源:VersionPrecondition.cs

示例2: Rule09

        //---------------------------------------------------------------------
        private static bool Rule09(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
        {
            bool		result = true;

            foreach (XmlElement context in nodeIndex.GetElementsByName ("cashSettlementPaymentDate"))
                result &= Rule09 (name, context.GetElementsByTagName ("businessDateRange"), errorHandler);

            return (result);
        }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:10,代码来源:SharedRules.cs

示例3: Rule02

        // --------------------------------------------------------------------
        private static bool Rule02(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
        {
            if (nodeIndex.HasTypeInformation)
                return (Rule02 (name, nodeIndex, nodeIndex.GetElementsByType (DetermineNamespace (nodeIndex), "PaymentCalculationPeriod"), errorHandler));

            return (Rule02 (name, nodeIndex, nodeIndex.GetElementsByName ("paymentCalculationPeriod"), errorHandler));
        }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:8,代码来源:PricingAndRiskRules.cs

示例4: Rule14

        // --------------------------------------------------------------------
        private static bool Rule14(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
        {
            bool			result	= true;

            foreach (XmlElement context in nodeIndex.GetElementsByName ("creditDefaultSwap")) {
                foreach (XmlElement seller in XPath.Paths (context, "protectionTerms", "creditEvents", "creditEventNotice", "notifyingParty", "sellerPartyReference")) {
                    if (Equal (seller.GetAttribute ("href"),
                            XPath.Path (context, "generalTerms", "sellerPartyReference").GetAttribute ("href")))
                        continue;

                    errorHandler ("305", context,
                        "If protectionTerms/creditEvents/creditEventNotice/notifyingParty/sellerPartyReference " +
                        "is present, its @href attribute must match that of generalTerms/sellerPartyReference",
                        name, null);

                    result = false;
                }
            }
            return (result);
        }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:21,代码来源:CdsRules.cs

示例5: Rule12

        // --------------------------------------------------------------------
        private static bool Rule12(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
        {
            bool			result	= true;

            foreach (XmlElement context in nodeIndex.GetElementsByName ("referenceInformation")) {
                if (Exists (context ["referencePrice"])) {
                    if (GreaterOrEqual (context ["referencePrice"], 0.0))
                        continue;

                    errorHandler ("305", context,
                        "If referencePrice is present it must not have a negative " +
                        "value",
                        name, context ["referencePrice"].InnerText);

                    result = false;
                }
            }
            return (result);
        }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:20,代码来源:CdsRules.cs

示例6: Rule10

        // --------------------------------------------------------------------
        private static bool Rule10(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
        {
            bool			result	= true;

            foreach (XmlElement context in nodeIndex.GetElementsByName ("referenceInformation")) {
                string			primaryReference;
                string			primaryId;

                foreach (XmlElement primary in XPath.Paths (context, "referenceObligation", "guarantorReference")) {
                    if (Equal (
                            primaryReference = primary.GetAttribute ("href"),
                            primaryId		 = context ["referenceEntity"].GetAttribute ("id")))
                        continue;

                    errorHandler ("305", context,
                        "Primary obligor reference '" + primaryReference +
                        "' should point to the reference entity ' " + primaryId + "'",
                        name, null);

                    result = false;
                }
            }
            return (result);
        }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:25,代码来源:CdsRules.cs

示例7: Rule06

        // --------------------------------------------------------------------
        private static bool Rule06(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
        {
            bool			result	= true;

            foreach (XmlElement context in nodeIndex.GetElementsByName ("generalTerms")) {
                XmlElement  buyer   = context ["buyerPartyReference"];
                XmlElement  seller  = context ["sellerPartyReference"];

                if ((buyer == null) || (seller == null) ||
                    NotEqual (buyer.GetAttribute ("href"), seller.GetAttribute ("href")))
                    continue;

                errorHandler ("305", context,
                    "Buyer party reference is equal to seller party reference",
                    name, seller.GetAttribute ("href"));

                result = false;
            }
            return (result);
        }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:21,代码来源:CdsRules.cs

示例8: Rule44

 // --------------------------------------------------------------------
 private static bool Rule44(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
 {
     return (Rule44 (name, nodeIndex.GetElementsByName ("creditDefaultSwap"), errorHandler));
 }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:5,代码来源:CdsRules.cs

示例9: Rule28

        // --------------------------------------------------------------------
        private static bool Rule28(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
        {
            bool		result = true;

            foreach (XmlElement context in nodeIndex.GetElementsByName ("creditDefaultSwap")) {
                XmlElement	paymentDate;
                XmlElement	effectiveDate;

                if (Implies (
                    Exists (XPath.Path (context, "feeLeg", "periodicPayment", "firstPaymentDate")),
                    Greater (
                        paymentDate = XPath.Path (context, "feeLeg", "periodicPayment", "firstPaymentDate"),
                        effectiveDate = XPath.Path (context, "generalTerms", "effectiveDate", "unadjustedDate"))))
                    continue;

                errorHandler ("305", context,
                    "First periodic payment date '" + paymentDate.InnerText + "' " +
                    "must be after the effective date '" + effectiveDate.InnerText + "'",
                    name, null);

                result = false;
            }
            return (result);
        }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:25,代码来源:CdsRules.cs

示例10: Rule17

        //---------------------------------------------------------------------
        private static bool Rule17(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
        {
            bool		result = true;

            foreach (XmlElement context in XPath.Paths (nodeIndex.GetElementsByName ("tradeSide"), "*", "account")) {
                string		href	= context.GetAttribute ("href");
                XmlElement	target  = nodeIndex.GetElementById (href);

                if (target.LocalName.Equals ("account")) continue;

                errorHandler ("305", context,
                    "The value of the href attribute does not refer to an account structure",
                    name, href);

                result = false;
            }
            return (result);
        }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:19,代码来源:SharedRules.cs

示例11: Rule15

 //---------------------------------------------------------------------
 private static bool Rule15(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
 {
     return (
         Rule15 (name, nodeIndex.GetElementsByName ("gracePeriod"), errorHandler)
         & Rule15 (name, nodeIndex.GetElementsByName ("paymentDaysOffset"), errorHandler)
         & Rule15 (name, nodeIndex.GetElementsByName ("rateCutOffDaysOffset"), errorHandler)
         & Rule15 (name, nodeIndex.GetElementsByName ("relativeDate"), errorHandler)
         & Rule15 (name, nodeIndex.GetElementsByName ("fixingDateOffset"), errorHandler)
         & Rule15 (name, nodeIndex.GetElementsByName ("initialFixingDate"), errorHandler)
         & Rule15 (name, nodeIndex.GetElementsByName ("fixingDates"), errorHandler)
         & Rule15 (name, nodeIndex.GetElementsByName ("cashSettlementValuationDate"), errorHandler)
         & Rule15 (name, nodeIndex.GetElementsByName ("varyingNotionalInterimExchangePaymentDates"), errorHandler)
         & Rule15 (name, nodeIndex.GetElementsByName ("varyingNotionalFixingDates"), errorHandler)
         & Rule15 (name, nodeIndex.GetElementsByName ("feePaymentDate"), errorHandler)
         & Rule15 (name, nodeIndex.GetElementsByName ("relativeDates"), errorHandler));
 }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:17,代码来源:SharedRules.cs

示例12: Rule14B

 //---------------------------------------------------------------------
 private static bool Rule14B(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
 {
     return (Rule14B (name, nodeIndex.GetElementsByName ("calculationAgentPartyReference"), errorHandler, nodeIndex));
 }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:5,代码来源:SharedRules.cs

示例13: Rule13A

 //---------------------------------------------------------------------
 private static bool Rule13A(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
 {
     return (Rule13A (name, nodeIndex.GetElementsByName ("sellerPartyReference"), errorHandler, nodeIndex));
 }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:5,代码来源:SharedRules.cs

示例14: Rule11

 //---------------------------------------------------------------------
 private static bool Rule11(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
 {
     return (Rule11 (name, nodeIndex.GetElementsByName ("businessDateRange"), errorHandler));
 }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:5,代码来源:SharedRules.cs

示例15: Rule10

 //---------------------------------------------------------------------
 private static bool Rule10(string name, NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
 {
     return (Rule10 (name, nodeIndex.GetElementsByName ("calculationAgent"), errorHandler));
 }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:5,代码来源:SharedRules.cs


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