public Valuation(XmlNode xmlNode) { XmlNodeList objectReferenceNodeList = xmlNode.SelectNodes("objectReference"); if (objectReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in objectReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { objectReferenceIDRef = item.Attributes["id"].Name; AnyAssetReference ob = AnyAssetReference(); IDManager.SetID(objectReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { objectReferenceIDRef = item.Attributes["href"].Name; } else { objectReference = new AnyAssetReference(item); } } } XmlNodeList valuationScenarioReferenceNodeList = xmlNode.SelectNodes("valuationScenarioReference"); if (valuationScenarioReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in valuationScenarioReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { valuationScenarioReferenceIDRef = item.Attributes["id"].Name; ValuationScenarioReference ob = ValuationScenarioReference(); IDManager.SetID(valuationScenarioReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { valuationScenarioReferenceIDRef = item.Attributes["href"].Name; } else { valuationScenarioReference = new ValuationScenarioReference(item); } } } }
public Valuation(XmlNode xmlNode) { XmlNodeList objectReferenceNodeList = xmlNode.SelectNodes("objectReference"); if (objectReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in objectReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { objectReferenceIDRef = item.Attributes["id"].Name; AnyAssetReference ob = AnyAssetReference(); IDManager.SetID(objectReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { objectReferenceIDRef = item.Attributes["href"].Name; } else { objectReference = new AnyAssetReference(item); } } } XmlNodeList valuationScenarioReferenceNodeList = xmlNode.SelectNodes("valuationScenarioReference"); if (valuationScenarioReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in valuationScenarioReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { valuationScenarioReferenceIDRef = item.Attributes["id"].Name; ValuationScenarioReference ob = ValuationScenarioReference(); IDManager.SetID(valuationScenarioReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { valuationScenarioReferenceIDRef = item.Attributes["href"].Name; } else { valuationScenarioReference = new ValuationScenarioReference(item); } } } }
public Valuation(XmlNode xmlNode) { XmlNode objectReferenceNode = xmlNode.SelectSingleNode("objectReference"); if (objectReferenceNode != null) { if (objectReferenceNode.Attributes["href"] != null || objectReferenceNode.Attributes["id"] != null) { if (objectReferenceNode.Attributes["id"] != null) { objectReferenceIDRef_ = objectReferenceNode.Attributes["id"].Value; AnyAssetReference ob = new AnyAssetReference(objectReferenceNode); IDManager.SetID(objectReferenceIDRef_, ob); } else if (objectReferenceNode.Attributes["href"] != null) { objectReferenceIDRef_ = objectReferenceNode.Attributes["href"].Value; } else { objectReference_ = new AnyAssetReference(objectReferenceNode); } } else { objectReference_ = new AnyAssetReference(objectReferenceNode); } } XmlNode valuationScenarioReferenceNode = xmlNode.SelectSingleNode("valuationScenarioReference"); if (valuationScenarioReferenceNode != null) { if (valuationScenarioReferenceNode.Attributes["href"] != null || valuationScenarioReferenceNode.Attributes["id"] != null) { if (valuationScenarioReferenceNode.Attributes["id"] != null) { valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["id"].Value; ValuationScenarioReference ob = new ValuationScenarioReference(valuationScenarioReferenceNode); IDManager.SetID(valuationScenarioReferenceIDRef_, ob); } else if (valuationScenarioReferenceNode.Attributes["href"] != null) { valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["href"].Value; } else { valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode); } } else { valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode); } } }
public Valuation(XmlNode xmlNode) { XmlNode objectReferenceNode = xmlNode.SelectSingleNode("objectReference"); if (objectReferenceNode != null) { if (objectReferenceNode.Attributes["href"] != null || objectReferenceNode.Attributes["id"] != null) { if (objectReferenceNode.Attributes["id"] != null) { objectReferenceIDRef_ = objectReferenceNode.Attributes["id"].Value; AnyAssetReference ob = new AnyAssetReference(objectReferenceNode); IDManager.SetID(objectReferenceIDRef_, ob); } else if (objectReferenceNode.Attributes["href"] != null) { objectReferenceIDRef_ = objectReferenceNode.Attributes["href"].Value; } else { objectReference_ = new AnyAssetReference(objectReferenceNode); } } else { objectReference_ = new AnyAssetReference(objectReferenceNode); } } XmlNode valuationScenarioReferenceNode = xmlNode.SelectSingleNode("valuationScenarioReference"); if (valuationScenarioReferenceNode != null) { if (valuationScenarioReferenceNode.Attributes["href"] != null || valuationScenarioReferenceNode.Attributes["id"] != null) { if (valuationScenarioReferenceNode.Attributes["id"] != null) { valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["id"].Value; ValuationScenarioReference ob = new ValuationScenarioReference(valuationScenarioReferenceNode); IDManager.SetID(valuationScenarioReferenceIDRef_, ob); } else if (valuationScenarioReferenceNode.Attributes["href"] != null) { valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["href"].Value; } else { valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode); } } else { valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode); } } }
public SensitivityDefinition(XmlNode xmlNode) { XmlNode nameNode = xmlNode.SelectSingleNode("name"); if (nameNode != null) { if (nameNode.Attributes["href"] != null || nameNode.Attributes["id"] != null) { if (nameNode.Attributes["id"] != null) { nameIDRef_ = nameNode.Attributes["id"].Value; XsdTypeString ob = new XsdTypeString(nameNode); IDManager.SetID(nameIDRef_, ob); } else if (nameNode.Attributes["href"] != null) { nameIDRef_ = nameNode.Attributes["href"].Value; } else { name_ = new XsdTypeString(nameNode); } } else { name_ = new XsdTypeString(nameNode); } } XmlNode valuationScenarioReferenceNode = xmlNode.SelectSingleNode("valuationScenarioReference"); if (valuationScenarioReferenceNode != null) { if (valuationScenarioReferenceNode.Attributes["href"] != null || valuationScenarioReferenceNode.Attributes["id"] != null) { if (valuationScenarioReferenceNode.Attributes["id"] != null) { valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["id"].Value; ValuationScenarioReference ob = new ValuationScenarioReference(valuationScenarioReferenceNode); IDManager.SetID(valuationScenarioReferenceIDRef_, ob); } else if (valuationScenarioReferenceNode.Attributes["href"] != null) { valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["href"].Value; } else { valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode); } } else { valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode); } } XmlNodeList partialDerivativeNodeList = xmlNode.SelectNodes("partialDerivative"); if (partialDerivativeNodeList != null) { this.partialDerivative_ = new List<PricingParameterDerivative>(); foreach (XmlNode item in partialDerivativeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { partialDerivativeIDRef_ = item.Attributes["id"].Value; partialDerivative_.Add(new PricingParameterDerivative(item)); IDManager.SetID(partialDerivativeIDRef_, partialDerivative_[partialDerivative_.Count - 1 ]); } else if (item.Attributes["href"] != null) { partialDerivativeIDRef_ = item.Attributes["href"].Value; } else { partialDerivative_.Add(new PricingParameterDerivative(item)); } } else { partialDerivative_.Add(new PricingParameterDerivative(item)); } } } XmlNode formulaNode = xmlNode.SelectSingleNode("formula"); if (formulaNode != null) { if (formulaNode.Attributes["href"] != null || formulaNode.Attributes["id"] != null) { if (formulaNode.Attributes["id"] != null) { formulaIDRef_ = formulaNode.Attributes["id"].Value; DerivativeFormula ob = new DerivativeFormula(formulaNode); IDManager.SetID(formulaIDRef_, ob); } else if (formulaNode.Attributes["href"] != null) { formulaIDRef_ = formulaNode.Attributes["href"].Value; } else { formula_ = new DerivativeFormula(formulaNode); } } else { formula_ = new DerivativeFormula(formulaNode); } } XmlNode termNode = xmlNode.SelectSingleNode("term"); if (termNode != null) { if (termNode.Attributes["href"] != null || termNode.Attributes["id"] != null) { if (termNode.Attributes["id"] != null) { termIDRef_ = termNode.Attributes["id"].Value; TimeDimension ob = new TimeDimension(termNode); IDManager.SetID(termIDRef_, ob); } else if (termNode.Attributes["href"] != null) { termIDRef_ = termNode.Attributes["href"].Value; } else { term_ = new TimeDimension(termNode); } } else { term_ = new TimeDimension(termNode); } } XmlNode coordinateNode = xmlNode.SelectSingleNode("coordinate"); if (coordinateNode != null) { if (coordinateNode.Attributes["href"] != null || coordinateNode.Attributes["id"] != null) { if (coordinateNode.Attributes["id"] != null) { coordinateIDRef_ = coordinateNode.Attributes["id"].Value; PricingDataPointCoordinate ob = new PricingDataPointCoordinate(coordinateNode); IDManager.SetID(coordinateIDRef_, ob); } else if (coordinateNode.Attributes["href"] != null) { coordinateIDRef_ = coordinateNode.Attributes["href"].Value; } else { coordinate_ = new PricingDataPointCoordinate(coordinateNode); } } else { coordinate_ = new PricingDataPointCoordinate(coordinateNode); } } XmlNode coordinateReferenceNode = xmlNode.SelectSingleNode("coordinateReference"); if (coordinateReferenceNode != null) { if (coordinateReferenceNode.Attributes["href"] != null || coordinateReferenceNode.Attributes["id"] != null) { if (coordinateReferenceNode.Attributes["id"] != null) { coordinateReferenceIDRef_ = coordinateReferenceNode.Attributes["id"].Value; PricingDataPointCoordinateReference ob = new PricingDataPointCoordinateReference(coordinateReferenceNode); IDManager.SetID(coordinateReferenceIDRef_, ob); } else if (coordinateReferenceNode.Attributes["href"] != null) { coordinateReferenceIDRef_ = coordinateReferenceNode.Attributes["href"].Value; } else { coordinateReference_ = new PricingDataPointCoordinateReference(coordinateReferenceNode); } } else { coordinateReference_ = new PricingDataPointCoordinateReference(coordinateReferenceNode); } } }
public SensitivityDefinition(XmlNode xmlNode) { XmlNode nameNode = xmlNode.SelectSingleNode("name"); if (nameNode != null) { if (nameNode.Attributes["href"] != null || nameNode.Attributes["id"] != null) { if (nameNode.Attributes["id"] != null) { nameIDRef_ = nameNode.Attributes["id"].Value; XsdTypeString ob = new XsdTypeString(nameNode); IDManager.SetID(nameIDRef_, ob); } else if (nameNode.Attributes["href"] != null) { nameIDRef_ = nameNode.Attributes["href"].Value; } else { name_ = new XsdTypeString(nameNode); } } else { name_ = new XsdTypeString(nameNode); } } XmlNode valuationScenarioReferenceNode = xmlNode.SelectSingleNode("valuationScenarioReference"); if (valuationScenarioReferenceNode != null) { if (valuationScenarioReferenceNode.Attributes["href"] != null || valuationScenarioReferenceNode.Attributes["id"] != null) { if (valuationScenarioReferenceNode.Attributes["id"] != null) { valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["id"].Value; ValuationScenarioReference ob = new ValuationScenarioReference(valuationScenarioReferenceNode); IDManager.SetID(valuationScenarioReferenceIDRef_, ob); } else if (valuationScenarioReferenceNode.Attributes["href"] != null) { valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["href"].Value; } else { valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode); } } else { valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode); } } XmlNodeList partialDerivativeNodeList = xmlNode.SelectNodes("partialDerivative"); if (partialDerivativeNodeList != null) { this.partialDerivative_ = new List <PricingParameterDerivative>(); foreach (XmlNode item in partialDerivativeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { partialDerivativeIDRef_ = item.Attributes["id"].Value; partialDerivative_.Add(new PricingParameterDerivative(item)); IDManager.SetID(partialDerivativeIDRef_, partialDerivative_[partialDerivative_.Count - 1]); } else if (item.Attributes["href"] != null) { partialDerivativeIDRef_ = item.Attributes["href"].Value; } else { partialDerivative_.Add(new PricingParameterDerivative(item)); } } else { partialDerivative_.Add(new PricingParameterDerivative(item)); } } } XmlNode formulaNode = xmlNode.SelectSingleNode("formula"); if (formulaNode != null) { if (formulaNode.Attributes["href"] != null || formulaNode.Attributes["id"] != null) { if (formulaNode.Attributes["id"] != null) { formulaIDRef_ = formulaNode.Attributes["id"].Value; DerivativeFormula ob = new DerivativeFormula(formulaNode); IDManager.SetID(formulaIDRef_, ob); } else if (formulaNode.Attributes["href"] != null) { formulaIDRef_ = formulaNode.Attributes["href"].Value; } else { formula_ = new DerivativeFormula(formulaNode); } } else { formula_ = new DerivativeFormula(formulaNode); } } XmlNode termNode = xmlNode.SelectSingleNode("term"); if (termNode != null) { if (termNode.Attributes["href"] != null || termNode.Attributes["id"] != null) { if (termNode.Attributes["id"] != null) { termIDRef_ = termNode.Attributes["id"].Value; TimeDimension ob = new TimeDimension(termNode); IDManager.SetID(termIDRef_, ob); } else if (termNode.Attributes["href"] != null) { termIDRef_ = termNode.Attributes["href"].Value; } else { term_ = new TimeDimension(termNode); } } else { term_ = new TimeDimension(termNode); } } XmlNode coordinateNode = xmlNode.SelectSingleNode("coordinate"); if (coordinateNode != null) { if (coordinateNode.Attributes["href"] != null || coordinateNode.Attributes["id"] != null) { if (coordinateNode.Attributes["id"] != null) { coordinateIDRef_ = coordinateNode.Attributes["id"].Value; PricingDataPointCoordinate ob = new PricingDataPointCoordinate(coordinateNode); IDManager.SetID(coordinateIDRef_, ob); } else if (coordinateNode.Attributes["href"] != null) { coordinateIDRef_ = coordinateNode.Attributes["href"].Value; } else { coordinate_ = new PricingDataPointCoordinate(coordinateNode); } } else { coordinate_ = new PricingDataPointCoordinate(coordinateNode); } } XmlNode coordinateReferenceNode = xmlNode.SelectSingleNode("coordinateReference"); if (coordinateReferenceNode != null) { if (coordinateReferenceNode.Attributes["href"] != null || coordinateReferenceNode.Attributes["id"] != null) { if (coordinateReferenceNode.Attributes["id"] != null) { coordinateReferenceIDRef_ = coordinateReferenceNode.Attributes["id"].Value; PricingDataPointCoordinateReference ob = new PricingDataPointCoordinateReference(coordinateReferenceNode); IDManager.SetID(coordinateReferenceIDRef_, ob); } else if (coordinateReferenceNode.Attributes["href"] != null) { coordinateReferenceIDRef_ = coordinateReferenceNode.Attributes["href"].Value; } else { coordinateReference_ = new PricingDataPointCoordinateReference(coordinateReferenceNode); } } else { coordinateReference_ = new PricingDataPointCoordinateReference(coordinateReferenceNode); } } }
public SensitivityDefinition(XmlNode xmlNode) { XmlNodeList nameNodeList = xmlNode.SelectNodes("name"); if (nameNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in nameNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { nameIDRef = item.Attributes["id"].Name; XsdTypeString ob = XsdTypeString(); IDManager.SetID(nameIDRef, ob); } else if (item.Attributes.ToString() == "href") { nameIDRef = item.Attributes["href"].Name; } else { name = new XsdTypeString(item); } } } XmlNodeList valuationScenarioReferenceNodeList = xmlNode.SelectNodes("valuationScenarioReference"); if (valuationScenarioReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in valuationScenarioReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { valuationScenarioReferenceIDRef = item.Attributes["id"].Name; ValuationScenarioReference ob = ValuationScenarioReference(); IDManager.SetID(valuationScenarioReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { valuationScenarioReferenceIDRef = item.Attributes["href"].Name; } else { valuationScenarioReference = new ValuationScenarioReference(item); } } } XmlNodeList partialDerivativeNodeList = xmlNode.SelectNodes("partialDerivative"); foreach (XmlNode item in partialDerivativeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { partialDerivativeIDRef = item.Attributes["id"].Name; List <PricingParameterDerivative> ob = new List <PricingParameterDerivative>(); ob.Add(new PricingParameterDerivative(item)); IDManager.SetID(partialDerivativeIDRef, ob); } else if (item.Attributes.ToString() == "href") { partialDerivativeIDRef = item.Attributes["href"].Name; } else { partialDerivative.Add(new PricingParameterDerivative(item)); } } } XmlNodeList formulaNodeList = xmlNode.SelectNodes("formula"); if (formulaNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in formulaNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { formulaIDRef = item.Attributes["id"].Name; DerivativeFormula ob = DerivativeFormula(); IDManager.SetID(formulaIDRef, ob); } else if (item.Attributes.ToString() == "href") { formulaIDRef = item.Attributes["href"].Name; } else { formula = new DerivativeFormula(item); } } } XmlNodeList termNodeList = xmlNode.SelectNodes("term"); if (termNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in termNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { termIDRef = item.Attributes["id"].Name; TimeDimension ob = TimeDimension(); IDManager.SetID(termIDRef, ob); } else if (item.Attributes.ToString() == "href") { termIDRef = item.Attributes["href"].Name; } else { term = new TimeDimension(item); } } } XmlNodeList coordinateNodeList = xmlNode.SelectNodes("coordinate"); if (coordinateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in coordinateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { coordinateIDRef = item.Attributes["id"].Name; PricingDataPointCoordinate ob = PricingDataPointCoordinate(); IDManager.SetID(coordinateIDRef, ob); } else if (item.Attributes.ToString() == "href") { coordinateIDRef = item.Attributes["href"].Name; } else { coordinate = new PricingDataPointCoordinate(item); } } } XmlNodeList coordinateReferenceNodeList = xmlNode.SelectNodes("coordinateReference"); if (coordinateReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in coordinateReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { coordinateReferenceIDRef = item.Attributes["id"].Name; PricingDataPointCoordinateReference ob = PricingDataPointCoordinateReference(); IDManager.SetID(coordinateReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { coordinateReferenceIDRef = item.Attributes["href"].Name; } else { coordinateReference = new PricingDataPointCoordinateReference(item); } } } }
public SensitivityDefinition(XmlNode xmlNode) { XmlNodeList nameNodeList = xmlNode.SelectNodes("name"); if (nameNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in nameNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { nameIDRef = item.Attributes["id"].Name; XsdTypeString ob = XsdTypeString(); IDManager.SetID(nameIDRef, ob); } else if (item.Attributes.ToString() == "href") { nameIDRef = item.Attributes["href"].Name; } else { name = new XsdTypeString(item); } } } XmlNodeList valuationScenarioReferenceNodeList = xmlNode.SelectNodes("valuationScenarioReference"); if (valuationScenarioReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in valuationScenarioReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { valuationScenarioReferenceIDRef = item.Attributes["id"].Name; ValuationScenarioReference ob = ValuationScenarioReference(); IDManager.SetID(valuationScenarioReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { valuationScenarioReferenceIDRef = item.Attributes["href"].Name; } else { valuationScenarioReference = new ValuationScenarioReference(item); } } } XmlNodeList partialDerivativeNodeList = xmlNode.SelectNodes("partialDerivative"); foreach (XmlNode item in partialDerivativeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { partialDerivativeIDRef = item.Attributes["id"].Name; List<PricingParameterDerivative> ob = new List<PricingParameterDerivative>(); ob.Add(new PricingParameterDerivative(item)); IDManager.SetID(partialDerivativeIDRef, ob); } else if (item.Attributes.ToString() == "href") { partialDerivativeIDRef = item.Attributes["href"].Name; } else { partialDerivative.Add(new PricingParameterDerivative(item)); } } } XmlNodeList formulaNodeList = xmlNode.SelectNodes("formula"); if (formulaNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in formulaNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { formulaIDRef = item.Attributes["id"].Name; DerivativeFormula ob = DerivativeFormula(); IDManager.SetID(formulaIDRef, ob); } else if (item.Attributes.ToString() == "href") { formulaIDRef = item.Attributes["href"].Name; } else { formula = new DerivativeFormula(item); } } } XmlNodeList termNodeList = xmlNode.SelectNodes("term"); if (termNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in termNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { termIDRef = item.Attributes["id"].Name; TimeDimension ob = TimeDimension(); IDManager.SetID(termIDRef, ob); } else if (item.Attributes.ToString() == "href") { termIDRef = item.Attributes["href"].Name; } else { term = new TimeDimension(item); } } } XmlNodeList coordinateNodeList = xmlNode.SelectNodes("coordinate"); if (coordinateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in coordinateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { coordinateIDRef = item.Attributes["id"].Name; PricingDataPointCoordinate ob = PricingDataPointCoordinate(); IDManager.SetID(coordinateIDRef, ob); } else if (item.Attributes.ToString() == "href") { coordinateIDRef = item.Attributes["href"].Name; } else { coordinate = new PricingDataPointCoordinate(item); } } } XmlNodeList coordinateReferenceNodeList = xmlNode.SelectNodes("coordinateReference"); if (coordinateReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in coordinateReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { coordinateReferenceIDRef = item.Attributes["id"].Name; PricingDataPointCoordinateReference ob = PricingDataPointCoordinateReference(); IDManager.SetID(coordinateReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { coordinateReferenceIDRef = item.Attributes["href"].Name; } else { coordinateReference = new PricingDataPointCoordinateReference(item); } } } }
public SensitivitySetDefinition(XmlNode xmlNode) { XmlNodeList nameNodeList = xmlNode.SelectNodes("name"); if (nameNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in nameNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { nameIDRef = item.Attributes["id"].Name; XsdTypeString ob = XsdTypeString(); IDManager.SetID(nameIDRef, ob); } else if (item.Attributes.ToString() == "href") { nameIDRef = item.Attributes["href"].Name; } else { name = new XsdTypeString(item); } } } XmlNodeList sensitivityCharacteristicsNodeList = xmlNode.SelectNodes("sensitivityCharacteristics"); if (sensitivityCharacteristicsNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in sensitivityCharacteristicsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sensitivityCharacteristicsIDRef = item.Attributes["id"].Name; QuotationCharacteristics ob = QuotationCharacteristics(); IDManager.SetID(sensitivityCharacteristicsIDRef, ob); } else if (item.Attributes.ToString() == "href") { sensitivityCharacteristicsIDRef = item.Attributes["href"].Name; } else { sensitivityCharacteristics = new QuotationCharacteristics(item); } } } XmlNodeList valuationScenarioReferenceNodeList = xmlNode.SelectNodes("valuationScenarioReference"); if (valuationScenarioReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in valuationScenarioReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { valuationScenarioReferenceIDRef = item.Attributes["id"].Name; ValuationScenarioReference ob = ValuationScenarioReference(); IDManager.SetID(valuationScenarioReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { valuationScenarioReferenceIDRef = item.Attributes["href"].Name; } else { valuationScenarioReference = new ValuationScenarioReference(item); } } } XmlNodeList pricingInputTypeNodeList = xmlNode.SelectNodes("pricingInputType"); if (pricingInputTypeNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in pricingInputTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { pricingInputTypeIDRef = item.Attributes["id"].Name; PricingInputType ob = PricingInputType(); IDManager.SetID(pricingInputTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { pricingInputTypeIDRef = item.Attributes["href"].Name; } else { pricingInputType = new PricingInputType(item); } } } XmlNodeList pricingInputReferenceNodeList = xmlNode.SelectNodes("pricingInputReference"); if (pricingInputReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in pricingInputReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { pricingInputReferenceIDRef = item.Attributes["id"].Name; PricingStructureReference ob = PricingStructureReference(); IDManager.SetID(pricingInputReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { pricingInputReferenceIDRef = item.Attributes["href"].Name; } else { pricingInputReference = new PricingStructureReference(item); } } } XmlNodeList scaleNodeList = xmlNode.SelectNodes("scale"); if (scaleNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in scaleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { scaleIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(scaleIDRef, ob); } else if (item.Attributes.ToString() == "href") { scaleIDRef = item.Attributes["href"].Name; } else { scale = new XsdTypeDecimal(item); } } } XmlNodeList sensitivityDefinitionNodeList = xmlNode.SelectNodes("sensitivityDefinition"); foreach (XmlNode item in sensitivityDefinitionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sensitivityDefinitionIDRef = item.Attributes["id"].Name; List <SensitivityDefinition> ob = new List <SensitivityDefinition>(); ob.Add(new SensitivityDefinition(item)); IDManager.SetID(sensitivityDefinitionIDRef, ob); } else if (item.Attributes.ToString() == "href") { sensitivityDefinitionIDRef = item.Attributes["href"].Name; } else { sensitivityDefinition.Add(new SensitivityDefinition(item)); } } } XmlNodeList calculationProcedureNodeList = xmlNode.SelectNodes("calculationProcedure"); if (calculationProcedureNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in calculationProcedureNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationProcedureIDRef = item.Attributes["id"].Name; DerivativeCalculationProcedure ob = DerivativeCalculationProcedure(); IDManager.SetID(calculationProcedureIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationProcedureIDRef = item.Attributes["href"].Name; } else { calculationProcedure = new DerivativeCalculationProcedure(item); } } } }
public SensitivitySetDefinition(XmlNode xmlNode) { XmlNodeList nameNodeList = xmlNode.SelectNodes("name"); if (nameNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in nameNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { nameIDRef = item.Attributes["id"].Name; XsdTypeString ob = XsdTypeString(); IDManager.SetID(nameIDRef, ob); } else if (item.Attributes.ToString() == "href") { nameIDRef = item.Attributes["href"].Name; } else { name = new XsdTypeString(item); } } } XmlNodeList sensitivityCharacteristicsNodeList = xmlNode.SelectNodes("sensitivityCharacteristics"); if (sensitivityCharacteristicsNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sensitivityCharacteristicsNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sensitivityCharacteristicsIDRef = item.Attributes["id"].Name; QuotationCharacteristics ob = QuotationCharacteristics(); IDManager.SetID(sensitivityCharacteristicsIDRef, ob); } else if (item.Attributes.ToString() == "href") { sensitivityCharacteristicsIDRef = item.Attributes["href"].Name; } else { sensitivityCharacteristics = new QuotationCharacteristics(item); } } } XmlNodeList valuationScenarioReferenceNodeList = xmlNode.SelectNodes("valuationScenarioReference"); if (valuationScenarioReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in valuationScenarioReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { valuationScenarioReferenceIDRef = item.Attributes["id"].Name; ValuationScenarioReference ob = ValuationScenarioReference(); IDManager.SetID(valuationScenarioReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { valuationScenarioReferenceIDRef = item.Attributes["href"].Name; } else { valuationScenarioReference = new ValuationScenarioReference(item); } } } XmlNodeList pricingInputTypeNodeList = xmlNode.SelectNodes("pricingInputType"); if (pricingInputTypeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in pricingInputTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { pricingInputTypeIDRef = item.Attributes["id"].Name; PricingInputType ob = PricingInputType(); IDManager.SetID(pricingInputTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { pricingInputTypeIDRef = item.Attributes["href"].Name; } else { pricingInputType = new PricingInputType(item); } } } XmlNodeList pricingInputReferenceNodeList = xmlNode.SelectNodes("pricingInputReference"); if (pricingInputReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in pricingInputReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { pricingInputReferenceIDRef = item.Attributes["id"].Name; PricingStructureReference ob = PricingStructureReference(); IDManager.SetID(pricingInputReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { pricingInputReferenceIDRef = item.Attributes["href"].Name; } else { pricingInputReference = new PricingStructureReference(item); } } } XmlNodeList scaleNodeList = xmlNode.SelectNodes("scale"); if (scaleNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in scaleNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { scaleIDRef = item.Attributes["id"].Name; XsdTypeDecimal ob = XsdTypeDecimal(); IDManager.SetID(scaleIDRef, ob); } else if (item.Attributes.ToString() == "href") { scaleIDRef = item.Attributes["href"].Name; } else { scale = new XsdTypeDecimal(item); } } } XmlNodeList sensitivityDefinitionNodeList = xmlNode.SelectNodes("sensitivityDefinition"); foreach (XmlNode item in sensitivityDefinitionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sensitivityDefinitionIDRef = item.Attributes["id"].Name; List<SensitivityDefinition> ob = new List<SensitivityDefinition>(); ob.Add(new SensitivityDefinition(item)); IDManager.SetID(sensitivityDefinitionIDRef, ob); } else if (item.Attributes.ToString() == "href") { sensitivityDefinitionIDRef = item.Attributes["href"].Name; } else { sensitivityDefinition.Add(new SensitivityDefinition(item)); } } } XmlNodeList calculationProcedureNodeList = xmlNode.SelectNodes("calculationProcedure"); if (calculationProcedureNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationProcedureNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationProcedureIDRef = item.Attributes["id"].Name; DerivativeCalculationProcedure ob = DerivativeCalculationProcedure(); IDManager.SetID(calculationProcedureIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationProcedureIDRef = item.Attributes["href"].Name; } else { calculationProcedure = new DerivativeCalculationProcedure(item); } } } }
public DerivedValuationScenario(XmlNode xmlNode) { XmlNode nameNode = xmlNode.SelectSingleNode("name"); if (nameNode != null) { if (nameNode.Attributes["href"] != null || nameNode.Attributes["id"] != null) { if (nameNode.Attributes["id"] != null) { nameIDRef_ = nameNode.Attributes["id"].Value; XsdTypeString ob = new XsdTypeString(nameNode); IDManager.SetID(nameIDRef_, ob); } else if (nameNode.Attributes["href"] != null) { nameIDRef_ = nameNode.Attributes["href"].Value; } else { name_ = new XsdTypeString(nameNode); } } else { name_ = new XsdTypeString(nameNode); } } XmlNode baseValuationScenarioNode = xmlNode.SelectSingleNode("baseValuationScenario"); if (baseValuationScenarioNode != null) { if (baseValuationScenarioNode.Attributes["href"] != null || baseValuationScenarioNode.Attributes["id"] != null) { if (baseValuationScenarioNode.Attributes["id"] != null) { baseValuationScenarioIDRef_ = baseValuationScenarioNode.Attributes["id"].Value; ValuationScenarioReference ob = new ValuationScenarioReference(baseValuationScenarioNode); IDManager.SetID(baseValuationScenarioIDRef_, ob); } else if (baseValuationScenarioNode.Attributes["href"] != null) { baseValuationScenarioIDRef_ = baseValuationScenarioNode.Attributes["href"].Value; } else { baseValuationScenario_ = new ValuationScenarioReference(baseValuationScenarioNode); } } else { baseValuationScenario_ = new ValuationScenarioReference(baseValuationScenarioNode); } } XmlNode valuationDateNode = xmlNode.SelectSingleNode("valuationDate"); if (valuationDateNode != null) { if (valuationDateNode.Attributes["href"] != null || valuationDateNode.Attributes["id"] != null) { if (valuationDateNode.Attributes["id"] != null) { valuationDateIDRef_ = valuationDateNode.Attributes["id"].Value; IdentifiedDate ob = new IdentifiedDate(valuationDateNode); IDManager.SetID(valuationDateIDRef_, ob); } else if (valuationDateNode.Attributes["href"] != null) { valuationDateIDRef_ = valuationDateNode.Attributes["href"].Value; } else { valuationDate_ = new IdentifiedDate(valuationDateNode); } } else { valuationDate_ = new IdentifiedDate(valuationDateNode); } } XmlNode marketReferenceNode = xmlNode.SelectSingleNode("marketReference"); if (marketReferenceNode != null) { if (marketReferenceNode.Attributes["href"] != null || marketReferenceNode.Attributes["id"] != null) { if (marketReferenceNode.Attributes["id"] != null) { marketReferenceIDRef_ = marketReferenceNode.Attributes["id"].Value; MarketReference ob = new MarketReference(marketReferenceNode); IDManager.SetID(marketReferenceIDRef_, ob); } else if (marketReferenceNode.Attributes["href"] != null) { marketReferenceIDRef_ = marketReferenceNode.Attributes["href"].Value; } else { marketReference_ = new MarketReference(marketReferenceNode); } } else { marketReference_ = new MarketReference(marketReferenceNode); } } XmlNodeList shiftNodeList = xmlNode.SelectNodes("shift"); if (shiftNodeList != null) { this.shift_ = new List <PricingParameterShift>(); foreach (XmlNode item in shiftNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { shiftIDRef_ = item.Attributes["id"].Value; shift_.Add(new PricingParameterShift(item)); IDManager.SetID(shiftIDRef_, shift_[shift_.Count - 1]); } else if (item.Attributes["href"] != null) { shiftIDRef_ = item.Attributes["href"].Value; } else { shift_.Add(new PricingParameterShift(item)); } } else { shift_.Add(new PricingParameterShift(item)); } } } }
public SensitivitySetDefinition(XmlNode xmlNode) { XmlNode nameNode = xmlNode.SelectSingleNode("name"); if (nameNode != null) { if (nameNode.Attributes["href"] != null || nameNode.Attributes["id"] != null) { if (nameNode.Attributes["id"] != null) { nameIDRef_ = nameNode.Attributes["id"].Value; XsdTypeString ob = new XsdTypeString(nameNode); IDManager.SetID(nameIDRef_, ob); } else if (nameNode.Attributes["href"] != null) { nameIDRef_ = nameNode.Attributes["href"].Value; } else { name_ = new XsdTypeString(nameNode); } } else { name_ = new XsdTypeString(nameNode); } } XmlNode sensitivityCharacteristicsNode = xmlNode.SelectSingleNode("sensitivityCharacteristics"); if (sensitivityCharacteristicsNode != null) { if (sensitivityCharacteristicsNode.Attributes["href"] != null || sensitivityCharacteristicsNode.Attributes["id"] != null) { if (sensitivityCharacteristicsNode.Attributes["id"] != null) { sensitivityCharacteristicsIDRef_ = sensitivityCharacteristicsNode.Attributes["id"].Value; QuotationCharacteristics ob = new QuotationCharacteristics(sensitivityCharacteristicsNode); IDManager.SetID(sensitivityCharacteristicsIDRef_, ob); } else if (sensitivityCharacteristicsNode.Attributes["href"] != null) { sensitivityCharacteristicsIDRef_ = sensitivityCharacteristicsNode.Attributes["href"].Value; } else { sensitivityCharacteristics_ = new QuotationCharacteristics(sensitivityCharacteristicsNode); } } else { sensitivityCharacteristics_ = new QuotationCharacteristics(sensitivityCharacteristicsNode); } } XmlNode valuationScenarioReferenceNode = xmlNode.SelectSingleNode("valuationScenarioReference"); if (valuationScenarioReferenceNode != null) { if (valuationScenarioReferenceNode.Attributes["href"] != null || valuationScenarioReferenceNode.Attributes["id"] != null) { if (valuationScenarioReferenceNode.Attributes["id"] != null) { valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["id"].Value; ValuationScenarioReference ob = new ValuationScenarioReference(valuationScenarioReferenceNode); IDManager.SetID(valuationScenarioReferenceIDRef_, ob); } else if (valuationScenarioReferenceNode.Attributes["href"] != null) { valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["href"].Value; } else { valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode); } } else { valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode); } } XmlNode pricingInputTypeNode = xmlNode.SelectSingleNode("pricingInputType"); if (pricingInputTypeNode != null) { if (pricingInputTypeNode.Attributes["href"] != null || pricingInputTypeNode.Attributes["id"] != null) { if (pricingInputTypeNode.Attributes["id"] != null) { pricingInputTypeIDRef_ = pricingInputTypeNode.Attributes["id"].Value; PricingInputType ob = new PricingInputType(pricingInputTypeNode); IDManager.SetID(pricingInputTypeIDRef_, ob); } else if (pricingInputTypeNode.Attributes["href"] != null) { pricingInputTypeIDRef_ = pricingInputTypeNode.Attributes["href"].Value; } else { pricingInputType_ = new PricingInputType(pricingInputTypeNode); } } else { pricingInputType_ = new PricingInputType(pricingInputTypeNode); } } XmlNode pricingInputReferenceNode = xmlNode.SelectSingleNode("pricingInputReference"); if (pricingInputReferenceNode != null) { if (pricingInputReferenceNode.Attributes["href"] != null || pricingInputReferenceNode.Attributes["id"] != null) { if (pricingInputReferenceNode.Attributes["id"] != null) { pricingInputReferenceIDRef_ = pricingInputReferenceNode.Attributes["id"].Value; PricingStructureReference ob = new PricingStructureReference(pricingInputReferenceNode); IDManager.SetID(pricingInputReferenceIDRef_, ob); } else if (pricingInputReferenceNode.Attributes["href"] != null) { pricingInputReferenceIDRef_ = pricingInputReferenceNode.Attributes["href"].Value; } else { pricingInputReference_ = new PricingStructureReference(pricingInputReferenceNode); } } else { pricingInputReference_ = new PricingStructureReference(pricingInputReferenceNode); } } XmlNode scaleNode = xmlNode.SelectSingleNode("scale"); if (scaleNode != null) { if (scaleNode.Attributes["href"] != null || scaleNode.Attributes["id"] != null) { if (scaleNode.Attributes["id"] != null) { scaleIDRef_ = scaleNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(scaleNode); IDManager.SetID(scaleIDRef_, ob); } else if (scaleNode.Attributes["href"] != null) { scaleIDRef_ = scaleNode.Attributes["href"].Value; } else { scale_ = new XsdTypeDecimal(scaleNode); } } else { scale_ = new XsdTypeDecimal(scaleNode); } } XmlNodeList sensitivityDefinitionNodeList = xmlNode.SelectNodes("sensitivityDefinition"); if (sensitivityDefinitionNodeList != null) { this.sensitivityDefinition_ = new List<SensitivityDefinition>(); foreach (XmlNode item in sensitivityDefinitionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { sensitivityDefinitionIDRef_ = item.Attributes["id"].Value; sensitivityDefinition_.Add(new SensitivityDefinition(item)); IDManager.SetID(sensitivityDefinitionIDRef_, sensitivityDefinition_[sensitivityDefinition_.Count - 1 ]); } else if (item.Attributes["href"] != null) { sensitivityDefinitionIDRef_ = item.Attributes["href"].Value; } else { sensitivityDefinition_.Add(new SensitivityDefinition(item)); } } else { sensitivityDefinition_.Add(new SensitivityDefinition(item)); } } } XmlNode calculationProcedureNode = xmlNode.SelectSingleNode("calculationProcedure"); if (calculationProcedureNode != null) { if (calculationProcedureNode.Attributes["href"] != null || calculationProcedureNode.Attributes["id"] != null) { if (calculationProcedureNode.Attributes["id"] != null) { calculationProcedureIDRef_ = calculationProcedureNode.Attributes["id"].Value; DerivativeCalculationProcedure ob = new DerivativeCalculationProcedure(calculationProcedureNode); IDManager.SetID(calculationProcedureIDRef_, ob); } else if (calculationProcedureNode.Attributes["href"] != null) { calculationProcedureIDRef_ = calculationProcedureNode.Attributes["href"].Value; } else { calculationProcedure_ = new DerivativeCalculationProcedure(calculationProcedureNode); } } else { calculationProcedure_ = new DerivativeCalculationProcedure(calculationProcedureNode); } } }
public DerivedValuationScenario(XmlNode xmlNode) { XmlNodeList nameNodeList = xmlNode.SelectNodes("name"); if (nameNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in nameNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { nameIDRef = item.Attributes["id"].Name; XsdTypeString ob = XsdTypeString(); IDManager.SetID(nameIDRef, ob); } else if (item.Attributes.ToString() == "href") { nameIDRef = item.Attributes["href"].Name; } else { name = new XsdTypeString(item); } } } XmlNodeList baseValuationScenarioNodeList = xmlNode.SelectNodes("baseValuationScenario"); if (baseValuationScenarioNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in baseValuationScenarioNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { baseValuationScenarioIDRef = item.Attributes["id"].Name; ValuationScenarioReference ob = ValuationScenarioReference(); IDManager.SetID(baseValuationScenarioIDRef, ob); } else if (item.Attributes.ToString() == "href") { baseValuationScenarioIDRef = item.Attributes["href"].Name; } else { baseValuationScenario = new ValuationScenarioReference(item); } } } XmlNodeList valuationDateNodeList = xmlNode.SelectNodes("valuationDate"); if (valuationDateNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in valuationDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { valuationDateIDRef = item.Attributes["id"].Name; IdentifiedDate ob = IdentifiedDate(); IDManager.SetID(valuationDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { valuationDateIDRef = item.Attributes["href"].Name; } else { valuationDate = new IdentifiedDate(item); } } } XmlNodeList marketReferenceNodeList = xmlNode.SelectNodes("marketReference"); if (marketReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in marketReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { marketReferenceIDRef = item.Attributes["id"].Name; MarketReference ob = MarketReference(); IDManager.SetID(marketReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { marketReferenceIDRef = item.Attributes["href"].Name; } else { marketReference = new MarketReference(item); } } } XmlNodeList shiftNodeList = xmlNode.SelectNodes("shift"); foreach (XmlNode item in shiftNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { shiftIDRef = item.Attributes["id"].Name; List <PricingParameterShift> ob = new List <PricingParameterShift>(); ob.Add(new PricingParameterShift(item)); IDManager.SetID(shiftIDRef, ob); } else if (item.Attributes.ToString() == "href") { shiftIDRef = item.Attributes["href"].Name; } else { shift.Add(new PricingParameterShift(item)); } } } }
public SensitivitySetDefinition(XmlNode xmlNode) { XmlNode nameNode = xmlNode.SelectSingleNode("name"); if (nameNode != null) { if (nameNode.Attributes["href"] != null || nameNode.Attributes["id"] != null) { if (nameNode.Attributes["id"] != null) { nameIDRef_ = nameNode.Attributes["id"].Value; XsdTypeString ob = new XsdTypeString(nameNode); IDManager.SetID(nameIDRef_, ob); } else if (nameNode.Attributes["href"] != null) { nameIDRef_ = nameNode.Attributes["href"].Value; } else { name_ = new XsdTypeString(nameNode); } } else { name_ = new XsdTypeString(nameNode); } } XmlNode sensitivityCharacteristicsNode = xmlNode.SelectSingleNode("sensitivityCharacteristics"); if (sensitivityCharacteristicsNode != null) { if (sensitivityCharacteristicsNode.Attributes["href"] != null || sensitivityCharacteristicsNode.Attributes["id"] != null) { if (sensitivityCharacteristicsNode.Attributes["id"] != null) { sensitivityCharacteristicsIDRef_ = sensitivityCharacteristicsNode.Attributes["id"].Value; QuotationCharacteristics ob = new QuotationCharacteristics(sensitivityCharacteristicsNode); IDManager.SetID(sensitivityCharacteristicsIDRef_, ob); } else if (sensitivityCharacteristicsNode.Attributes["href"] != null) { sensitivityCharacteristicsIDRef_ = sensitivityCharacteristicsNode.Attributes["href"].Value; } else { sensitivityCharacteristics_ = new QuotationCharacteristics(sensitivityCharacteristicsNode); } } else { sensitivityCharacteristics_ = new QuotationCharacteristics(sensitivityCharacteristicsNode); } } XmlNode valuationScenarioReferenceNode = xmlNode.SelectSingleNode("valuationScenarioReference"); if (valuationScenarioReferenceNode != null) { if (valuationScenarioReferenceNode.Attributes["href"] != null || valuationScenarioReferenceNode.Attributes["id"] != null) { if (valuationScenarioReferenceNode.Attributes["id"] != null) { valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["id"].Value; ValuationScenarioReference ob = new ValuationScenarioReference(valuationScenarioReferenceNode); IDManager.SetID(valuationScenarioReferenceIDRef_, ob); } else if (valuationScenarioReferenceNode.Attributes["href"] != null) { valuationScenarioReferenceIDRef_ = valuationScenarioReferenceNode.Attributes["href"].Value; } else { valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode); } } else { valuationScenarioReference_ = new ValuationScenarioReference(valuationScenarioReferenceNode); } } XmlNode pricingInputTypeNode = xmlNode.SelectSingleNode("pricingInputType"); if (pricingInputTypeNode != null) { if (pricingInputTypeNode.Attributes["href"] != null || pricingInputTypeNode.Attributes["id"] != null) { if (pricingInputTypeNode.Attributes["id"] != null) { pricingInputTypeIDRef_ = pricingInputTypeNode.Attributes["id"].Value; PricingInputType ob = new PricingInputType(pricingInputTypeNode); IDManager.SetID(pricingInputTypeIDRef_, ob); } else if (pricingInputTypeNode.Attributes["href"] != null) { pricingInputTypeIDRef_ = pricingInputTypeNode.Attributes["href"].Value; } else { pricingInputType_ = new PricingInputType(pricingInputTypeNode); } } else { pricingInputType_ = new PricingInputType(pricingInputTypeNode); } } XmlNode pricingInputReferenceNode = xmlNode.SelectSingleNode("pricingInputReference"); if (pricingInputReferenceNode != null) { if (pricingInputReferenceNode.Attributes["href"] != null || pricingInputReferenceNode.Attributes["id"] != null) { if (pricingInputReferenceNode.Attributes["id"] != null) { pricingInputReferenceIDRef_ = pricingInputReferenceNode.Attributes["id"].Value; PricingStructureReference ob = new PricingStructureReference(pricingInputReferenceNode); IDManager.SetID(pricingInputReferenceIDRef_, ob); } else if (pricingInputReferenceNode.Attributes["href"] != null) { pricingInputReferenceIDRef_ = pricingInputReferenceNode.Attributes["href"].Value; } else { pricingInputReference_ = new PricingStructureReference(pricingInputReferenceNode); } } else { pricingInputReference_ = new PricingStructureReference(pricingInputReferenceNode); } } XmlNode scaleNode = xmlNode.SelectSingleNode("scale"); if (scaleNode != null) { if (scaleNode.Attributes["href"] != null || scaleNode.Attributes["id"] != null) { if (scaleNode.Attributes["id"] != null) { scaleIDRef_ = scaleNode.Attributes["id"].Value; XsdTypeDecimal ob = new XsdTypeDecimal(scaleNode); IDManager.SetID(scaleIDRef_, ob); } else if (scaleNode.Attributes["href"] != null) { scaleIDRef_ = scaleNode.Attributes["href"].Value; } else { scale_ = new XsdTypeDecimal(scaleNode); } } else { scale_ = new XsdTypeDecimal(scaleNode); } } XmlNodeList sensitivityDefinitionNodeList = xmlNode.SelectNodes("sensitivityDefinition"); if (sensitivityDefinitionNodeList != null) { this.sensitivityDefinition_ = new List <SensitivityDefinition>(); foreach (XmlNode item in sensitivityDefinitionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { sensitivityDefinitionIDRef_ = item.Attributes["id"].Value; sensitivityDefinition_.Add(new SensitivityDefinition(item)); IDManager.SetID(sensitivityDefinitionIDRef_, sensitivityDefinition_[sensitivityDefinition_.Count - 1]); } else if (item.Attributes["href"] != null) { sensitivityDefinitionIDRef_ = item.Attributes["href"].Value; } else { sensitivityDefinition_.Add(new SensitivityDefinition(item)); } } else { sensitivityDefinition_.Add(new SensitivityDefinition(item)); } } } XmlNode calculationProcedureNode = xmlNode.SelectSingleNode("calculationProcedure"); if (calculationProcedureNode != null) { if (calculationProcedureNode.Attributes["href"] != null || calculationProcedureNode.Attributes["id"] != null) { if (calculationProcedureNode.Attributes["id"] != null) { calculationProcedureIDRef_ = calculationProcedureNode.Attributes["id"].Value; DerivativeCalculationProcedure ob = new DerivativeCalculationProcedure(calculationProcedureNode); IDManager.SetID(calculationProcedureIDRef_, ob); } else if (calculationProcedureNode.Attributes["href"] != null) { calculationProcedureIDRef_ = calculationProcedureNode.Attributes["href"].Value; } else { calculationProcedure_ = new DerivativeCalculationProcedure(calculationProcedureNode); } } else { calculationProcedure_ = new DerivativeCalculationProcedure(calculationProcedureNode); } } }
public DerivedValuationScenario(XmlNode xmlNode) { XmlNode nameNode = xmlNode.SelectSingleNode("name"); if (nameNode != null) { if (nameNode.Attributes["href"] != null || nameNode.Attributes["id"] != null) { if (nameNode.Attributes["id"] != null) { nameIDRef_ = nameNode.Attributes["id"].Value; XsdTypeString ob = new XsdTypeString(nameNode); IDManager.SetID(nameIDRef_, ob); } else if (nameNode.Attributes["href"] != null) { nameIDRef_ = nameNode.Attributes["href"].Value; } else { name_ = new XsdTypeString(nameNode); } } else { name_ = new XsdTypeString(nameNode); } } XmlNode baseValuationScenarioNode = xmlNode.SelectSingleNode("baseValuationScenario"); if (baseValuationScenarioNode != null) { if (baseValuationScenarioNode.Attributes["href"] != null || baseValuationScenarioNode.Attributes["id"] != null) { if (baseValuationScenarioNode.Attributes["id"] != null) { baseValuationScenarioIDRef_ = baseValuationScenarioNode.Attributes["id"].Value; ValuationScenarioReference ob = new ValuationScenarioReference(baseValuationScenarioNode); IDManager.SetID(baseValuationScenarioIDRef_, ob); } else if (baseValuationScenarioNode.Attributes["href"] != null) { baseValuationScenarioIDRef_ = baseValuationScenarioNode.Attributes["href"].Value; } else { baseValuationScenario_ = new ValuationScenarioReference(baseValuationScenarioNode); } } else { baseValuationScenario_ = new ValuationScenarioReference(baseValuationScenarioNode); } } XmlNode valuationDateNode = xmlNode.SelectSingleNode("valuationDate"); if (valuationDateNode != null) { if (valuationDateNode.Attributes["href"] != null || valuationDateNode.Attributes["id"] != null) { if (valuationDateNode.Attributes["id"] != null) { valuationDateIDRef_ = valuationDateNode.Attributes["id"].Value; IdentifiedDate ob = new IdentifiedDate(valuationDateNode); IDManager.SetID(valuationDateIDRef_, ob); } else if (valuationDateNode.Attributes["href"] != null) { valuationDateIDRef_ = valuationDateNode.Attributes["href"].Value; } else { valuationDate_ = new IdentifiedDate(valuationDateNode); } } else { valuationDate_ = new IdentifiedDate(valuationDateNode); } } XmlNode marketReferenceNode = xmlNode.SelectSingleNode("marketReference"); if (marketReferenceNode != null) { if (marketReferenceNode.Attributes["href"] != null || marketReferenceNode.Attributes["id"] != null) { if (marketReferenceNode.Attributes["id"] != null) { marketReferenceIDRef_ = marketReferenceNode.Attributes["id"].Value; MarketReference ob = new MarketReference(marketReferenceNode); IDManager.SetID(marketReferenceIDRef_, ob); } else if (marketReferenceNode.Attributes["href"] != null) { marketReferenceIDRef_ = marketReferenceNode.Attributes["href"].Value; } else { marketReference_ = new MarketReference(marketReferenceNode); } } else { marketReference_ = new MarketReference(marketReferenceNode); } } XmlNodeList shiftNodeList = xmlNode.SelectNodes("shift"); if (shiftNodeList != null) { this.shift_ = new List<PricingParameterShift>(); foreach (XmlNode item in shiftNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] != null) { if (item.Attributes["id"] != null) { shiftIDRef_ = item.Attributes["id"].Value; shift_.Add(new PricingParameterShift(item)); IDManager.SetID(shiftIDRef_, shift_[shift_.Count - 1 ]); } else if (item.Attributes["href"] != null) { shiftIDRef_ = item.Attributes["href"].Value; } else { shift_.Add(new PricingParameterShift(item)); } } else { shift_.Add(new PricingParameterShift(item)); } } } }
public DerivedValuationScenario(XmlNode xmlNode) { XmlNodeList nameNodeList = xmlNode.SelectNodes("name"); if (nameNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in nameNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { nameIDRef = item.Attributes["id"].Name; XsdTypeString ob = XsdTypeString(); IDManager.SetID(nameIDRef, ob); } else if (item.Attributes.ToString() == "href") { nameIDRef = item.Attributes["href"].Name; } else { name = new XsdTypeString(item); } } } XmlNodeList baseValuationScenarioNodeList = xmlNode.SelectNodes("baseValuationScenario"); if (baseValuationScenarioNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in baseValuationScenarioNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { baseValuationScenarioIDRef = item.Attributes["id"].Name; ValuationScenarioReference ob = ValuationScenarioReference(); IDManager.SetID(baseValuationScenarioIDRef, ob); } else if (item.Attributes.ToString() == "href") { baseValuationScenarioIDRef = item.Attributes["href"].Name; } else { baseValuationScenario = new ValuationScenarioReference(item); } } } XmlNodeList valuationDateNodeList = xmlNode.SelectNodes("valuationDate"); if (valuationDateNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in valuationDateNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { valuationDateIDRef = item.Attributes["id"].Name; IdentifiedDate ob = IdentifiedDate(); IDManager.SetID(valuationDateIDRef, ob); } else if (item.Attributes.ToString() == "href") { valuationDateIDRef = item.Attributes["href"].Name; } else { valuationDate = new IdentifiedDate(item); } } } XmlNodeList marketReferenceNodeList = xmlNode.SelectNodes("marketReference"); if (marketReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in marketReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { marketReferenceIDRef = item.Attributes["id"].Name; MarketReference ob = MarketReference(); IDManager.SetID(marketReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { marketReferenceIDRef = item.Attributes["href"].Name; } else { marketReference = new MarketReference(item); } } } XmlNodeList shiftNodeList = xmlNode.SelectNodes("shift"); foreach (XmlNode item in shiftNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { shiftIDRef = item.Attributes["id"].Name; List<PricingParameterShift> ob = new List<PricingParameterShift>(); ob.Add(new PricingParameterShift(item)); IDManager.SetID(shiftIDRef, ob); } else if (item.Attributes.ToString() == "href") { shiftIDRef = item.Attributes["href"].Name; } else { shift.Add(new PricingParameterShift(item)); } } } }