public SwapStreamPara(XmlNode xmlNode)
 : base(xmlNode)
 {
     XmlNode notionalNode = xmlNode.SelectSingleNode("notional");
     
     if (notionalNode != null)
     {
         if (notionalNode.Attributes["href"] != null || notionalNode.Attributes["id"] != null) 
         {
             if (notionalNode.Attributes["id"] != null) 
             {
                 notionalIDRef_ = notionalNode.Attributes["id"].Value;
                 XsdTypeDouble ob = new XsdTypeDouble(notionalNode);
                 IDManager.SetID(notionalIDRef_, ob);
             }
             else if (notionalNode.Attributes["href"] != null)
             {
                 notionalIDRef_ = notionalNode.Attributes["href"].Value;
             }
             else
             {
                 notional_ = new XsdTypeDouble(notionalNode);
             }
         }
         else
         {
             notional_ = new XsdTypeDouble(notionalNode);
         }
     }
     
 
     XmlNode discountCurveNode = xmlNode.SelectSingleNode("discountCurve");
     
     if (discountCurveNode != null)
     {
         if (discountCurveNode.Attributes["href"] != null || discountCurveNode.Attributes["id"] != null) 
         {
             if (discountCurveNode.Attributes["id"] != null) 
             {
                 discountCurveIDRef_ = discountCurveNode.Attributes["id"].Value;
                 DiscountCurve ob = new DiscountCurve(discountCurveNode);
                 IDManager.SetID(discountCurveIDRef_, ob);
             }
             else if (discountCurveNode.Attributes["href"] != null)
             {
                 discountCurveIDRef_ = discountCurveNode.Attributes["href"].Value;
             }
             else
             {
                 discountCurve_ = new DiscountCurve(discountCurveNode);
             }
         }
         else
         {
             discountCurve_ = new DiscountCurve(discountCurveNode);
         }
     }
     
 
 }
Example #2
0
        public SwapStreamPara(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode notionalNode = xmlNode.SelectSingleNode("notional");

            if (notionalNode != null)
            {
                if (notionalNode.Attributes["href"] != null || notionalNode.Attributes["id"] != null)
                {
                    if (notionalNode.Attributes["id"] != null)
                    {
                        notionalIDRef_ = notionalNode.Attributes["id"].Value;
                        XsdTypeDouble ob = new XsdTypeDouble(notionalNode);
                        IDManager.SetID(notionalIDRef_, ob);
                    }
                    else if (notionalNode.Attributes["href"] != null)
                    {
                        notionalIDRef_ = notionalNode.Attributes["href"].Value;
                    }
                    else
                    {
                        notional_ = new XsdTypeDouble(notionalNode);
                    }
                }
                else
                {
                    notional_ = new XsdTypeDouble(notionalNode);
                }
            }


            XmlNode discountCurveNode = xmlNode.SelectSingleNode("discountCurve");

            if (discountCurveNode != null)
            {
                if (discountCurveNode.Attributes["href"] != null || discountCurveNode.Attributes["id"] != null)
                {
                    if (discountCurveNode.Attributes["id"] != null)
                    {
                        discountCurveIDRef_ = discountCurveNode.Attributes["id"].Value;
                        DiscountCurve ob = new DiscountCurve(discountCurveNode);
                        IDManager.SetID(discountCurveIDRef_, ob);
                    }
                    else if (discountCurveNode.Attributes["href"] != null)
                    {
                        discountCurveIDRef_ = discountCurveNode.Attributes["href"].Value;
                    }
                    else
                    {
                        discountCurve_ = new DiscountCurve(discountCurveNode);
                    }
                }
                else
                {
                    discountCurve_ = new DiscountCurve(discountCurveNode);
                }
            }
        }
        public CreditDefaultSwapPricing(XmlNode xmlNode)
            : base(xmlNode)
        {
            XmlNode calculationAmountNode = xmlNode.SelectSingleNode("calculationAmount");

            if (calculationAmountNode != null)
            {
                if (calculationAmountNode.Attributes["href"] != null || calculationAmountNode.Attributes["id"] != null)
                {
                    if (calculationAmountNode.Attributes["id"] != null)
                    {
                        calculationAmountIDRef_ = calculationAmountNode.Attributes["id"].Value;
                        CalculationAmount ob = new CalculationAmount(calculationAmountNode);
                        IDManager.SetID(calculationAmountIDRef_, ob);
                    }
                    else if (calculationAmountNode.Attributes["href"] != null)
                    {
                        calculationAmountIDRef_ = calculationAmountNode.Attributes["href"].Value;
                    }
                    else
                    {
                        calculationAmount_ = new CalculationAmount(calculationAmountNode);
                    }
                }
                else
                {
                    calculationAmount_ = new CalculationAmount(calculationAmountNode);
                }
            }


            XmlNode referenceEntityInfoNode = xmlNode.SelectSingleNode("referenceEntityInfo");

            if (referenceEntityInfoNode != null)
            {
                if (referenceEntityInfoNode.Attributes["href"] != null || referenceEntityInfoNode.Attributes["id"] != null)
                {
                    if (referenceEntityInfoNode.Attributes["id"] != null)
                    {
                        referenceEntityInfoIDRef_ = referenceEntityInfoNode.Attributes["id"].Value;
                        ReferenceEntityInfo ob = new ReferenceEntityInfo(referenceEntityInfoNode);
                        IDManager.SetID(referenceEntityInfoIDRef_, ob);
                    }
                    else if (referenceEntityInfoNode.Attributes["href"] != null)
                    {
                        referenceEntityInfoIDRef_ = referenceEntityInfoNode.Attributes["href"].Value;
                    }
                    else
                    {
                        referenceEntityInfo_ = new ReferenceEntityInfo(referenceEntityInfoNode);
                    }
                }
                else
                {
                    referenceEntityInfo_ = new ReferenceEntityInfo(referenceEntityInfoNode);
                }
            }


            XmlNode evaluationCurvesNode = xmlNode.SelectSingleNode("evaluationCurves");

            if (evaluationCurvesNode != null)
            {
                if (evaluationCurvesNode.Attributes["href"] != null || evaluationCurvesNode.Attributes["id"] != null)
                {
                    if (evaluationCurvesNode.Attributes["id"] != null)
                    {
                        evaluationCurvesIDRef_ = evaluationCurvesNode.Attributes["id"].Value;
                        EvaluationCurves ob = new EvaluationCurves(evaluationCurvesNode);
                        IDManager.SetID(evaluationCurvesIDRef_, ob);
                    }
                    else if (evaluationCurvesNode.Attributes["href"] != null)
                    {
                        evaluationCurvesIDRef_ = evaluationCurvesNode.Attributes["href"].Value;
                    }
                    else
                    {
                        evaluationCurves_ = new EvaluationCurves(evaluationCurvesNode);
                    }
                }
                else
                {
                    evaluationCurves_ = new EvaluationCurves(evaluationCurvesNode);
                }
            }


            XmlNode discountCurveNode = xmlNode.SelectSingleNode("discountCurve");

            if (discountCurveNode != null)
            {
                if (discountCurveNode.Attributes["href"] != null || discountCurveNode.Attributes["id"] != null)
                {
                    if (discountCurveNode.Attributes["id"] != null)
                    {
                        discountCurveIDRef_ = discountCurveNode.Attributes["id"].Value;
                        DiscountCurve ob = new DiscountCurve(discountCurveNode);
                        IDManager.SetID(discountCurveIDRef_, ob);
                    }
                    else if (discountCurveNode.Attributes["href"] != null)
                    {
                        discountCurveIDRef_ = discountCurveNode.Attributes["href"].Value;
                    }
                    else
                    {
                        discountCurve_ = new DiscountCurve(discountCurveNode);
                    }
                }
                else
                {
                    discountCurve_ = new DiscountCurve(discountCurveNode);
                }
            }


            XmlNode recoveryRateNode = xmlNode.SelectSingleNode("recoveryRate");

            if (recoveryRateNode != null)
            {
                if (recoveryRateNode.Attributes["href"] != null || recoveryRateNode.Attributes["id"] != null)
                {
                    if (recoveryRateNode.Attributes["id"] != null)
                    {
                        recoveryRateIDRef_ = recoveryRateNode.Attributes["id"].Value;
                        XsdTypeDouble ob = new XsdTypeDouble(recoveryRateNode);
                        IDManager.SetID(recoveryRateIDRef_, ob);
                    }
                    else if (recoveryRateNode.Attributes["href"] != null)
                    {
                        recoveryRateIDRef_ = recoveryRateNode.Attributes["href"].Value;
                    }
                    else
                    {
                        recoveryRate_ = new XsdTypeDouble(recoveryRateNode);
                    }
                }
                else
                {
                    recoveryRate_ = new XsdTypeDouble(recoveryRateNode);
                }
            }
        }