• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Xml.NodeIndex类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



NodeIndex类属于HandCoded.Xml命名空间,在下文中一共展示了NodeIndex类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: 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)
        {
            if (nodeIndex.HasTypeInformation) {
                string ns = FpMLRuleSet.DetermineNamespace (nodeIndex);

                foreach (string type in types) {
                    XmlNodeList list = nodeIndex.GetElementsByType (ns, type);

                    if ((list != null) && (list.Count > 0)) return (true);
                }
            }
            else {
                foreach (String element in elements) {
                    XmlNodeList list = nodeIndex.GetElementsByName (element);

                    if ((list != null) && (list.Count > 0)) return (true);
                }
            }
            return (false);
        }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:28,代码来源:ContentPrecondition.cs


示例3: Rule02

        private static bool Rule02(string name, NodeIndex nodeIndex, XmlNodeList list, ValidationErrorHandler errorHandler)
        {
            bool		result 	= true;

            foreach (XmlElement context in list) {
                XmlElement	    startDate	= XPath.Path (context, "novation", "firstPeriodStartDate");
                XmlAttribute	href;

                if ((startDate == null) || (href = startDate.GetAttributeNode ("href"))== null) continue;

                XmlElement		target	= nodeIndex.GetElementById (href.Value);

                if ((target == null) || !target.LocalName.Equals("party")) {
                    errorHandler ("305", context,
                        "The @href attribute on the firstPeriodStartDate must reference a party",
                        name, href.Value);

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


示例4: PerformValidation

 internal bool PerformValidation(NodeIndex nodeIndex, ValidationErrorHandler errorHandler)
 {
     return (Validate (nodeIndex, errorHandler));
 }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:4,代码来源:Validator.cs


示例5: AppliesTo

 /// <summary>
 /// Determines if the <b>Rule</b> applies to a document but evaluating
 /// its <see cref="Precondition"/>.
 /// </summary>
 /// <param name="nodeIndex">The <see cref="NodeIndex"/> of the document.</param>
 /// <returns><c>true</c> if the <b>Rule</b> applies, <c>false</c> otherwise.</returns>
 public bool AppliesTo(NodeIndex nodeIndex)
 {
     return (precondition.Evaluate (nodeIndex, new Dictionary<Precondition,bool> ()));
 }
开发者ID:formicary,项目名称:fpml-toolkit-csharp,代码行数:10,代码来源:Rule.cs


示例6: Rule01

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

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


示例7: 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


示例8: 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


示例9: 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


示例10: Rule37

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


示例11: Rule36

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


示例12: Rule35

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


示例13: Rule34

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


示例14: Rule33

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


示例15: Rule30

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

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

                if (And (
                    Exists (paymentDate = XPath.Path (context, "feeLeg", "periodicPayment", "lastRegularPaymentDate")),
                    Exists (terminationDate = XPath.Path (context, "generalTerms", "scheduledTerminationDate", "adjustableDate", "unadjustedDate")))) {
                    if (Less (paymentDate, terminationDate)) continue;

                    errorHandler ("305", context,
                        "Last regular periodic payment date '" + paymentDate.InnerText + "' " +
                        "must be before the termination date '" + terminationDate.InnerText + "'",
                        name, null);

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


示例16: 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


示例17: Rule11

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

            foreach (XmlElement trade in nodeIndex.GetElementsByName ("trade")) {
                if (IsIsda2003 (trade) && IsLongForm (trade)) {
                    XmlElement	context = XPath.Path (trade, "creditDefaultSwap", "generalTerms", "referenceInformation") as XmlElement;

                    if (Exists (XPath.Path (context, "allGuarantees"))) continue;

                    errorHandler ("305", context,
                        "allGuarantees element missing in protection terms",
                        name, null);

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


示例18: Rule41

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

            foreach (XmlElement context in nodeIndex.GetElementsByName ("generalTerms")) {
                XmlElement		tranche		= XPath.Path (context, "indexReferenceInformation", "tranche");
                XmlElement		delivery	= XPath.Path (context, "modifiedEquityDelivery");

                if ((tranche == null) && (delivery != null)) {
                    errorHandler ("305", context,
                        "If indexReferenceInformation/tranche is not present then modifiedEquityDelivery must not be present.",
                        name, null);

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


示例19: Rule13

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

            foreach (XmlElement context in nodeIndex.GetElementsByName ("creditDefaultSwap")) {
                foreach (XmlElement buyer in XPath.Paths (context, "protectionTerms", "creditEvents", "creditEventNotice", "notifyingParty", "buyerPartyReference")) {
                    string		buyerName;
                    string		referenceName;

                    if (Equal (
                            buyerName = buyer.GetAttribute ("href"),
                            referenceName = XPath.Path (context, "generalTerms", "buyerPartyReference").GetAttribute ("href")))
                        continue;

                    errorHandler ("305", context,
                        "Credit event notice references buyer party reference " + buyerName +
                        " but general terms references " + referenceName,
                        name, null);

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


示例20: Rule42

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

            foreach (XmlElement context in nodeIndex.GetElementsByName ("generalTerms")) {
                XmlElement	basket			= XPath.Path (context, "basketReferenceInformation");
                XmlElement	substitution	= XPath.Path (context, "substitution");

                if ((basket == null) && (substitution != null)) {
                    errorHandler ("305", context,
                        "If basketReferenceInformation is not present then substitution must not be present.",
                        name, null);

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# HandlebarsDotNet.HelperOptions类代码示例发布时间:2022-05-26
下一篇:
C# Model.Preset类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap