public LegAmount(XmlNode xmlNode) { XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency"); if (currencyNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in currencyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { currencyIDRef = item.Attributes["id"].Name; IdentifiedCurrency ob = IdentifiedCurrency(); IDManager.SetID(currencyIDRef, ob); } else if (item.Attributes.ToString() == "href") { currencyIDRef = item.Attributes["href"].Name; } else { currency = new IdentifiedCurrency(item); } } } XmlNodeList determinationMethodNodeList = xmlNode.SelectNodes("determinationMethod"); if (determinationMethodNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in determinationMethodNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { determinationMethodIDRef = item.Attributes["id"].Name; DeterminationMethod ob = DeterminationMethod(); IDManager.SetID(determinationMethodIDRef, ob); } else if (item.Attributes.ToString() == "href") { determinationMethodIDRef = item.Attributes["href"].Name; } else { determinationMethod = new DeterminationMethod(item); } } } XmlNodeList currencyReferenceNodeList = xmlNode.SelectNodes("currencyReference"); if (currencyReferenceNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in currencyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { currencyReferenceIDRef = item.Attributes["id"].Name; IdentifiedCurrencyReference ob = IdentifiedCurrencyReference(); IDManager.SetID(currencyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { currencyReferenceIDRef = item.Attributes["href"].Name; } else { currencyReference = new IdentifiedCurrencyReference(item); } } } XmlNodeList referenceAmountNodeList = xmlNode.SelectNodes("referenceAmount"); if (referenceAmountNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in referenceAmountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { referenceAmountIDRef = item.Attributes["id"].Name; ReferenceAmount ob = ReferenceAmount(); IDManager.SetID(referenceAmountIDRef, ob); } else if (item.Attributes.ToString() == "href") { referenceAmountIDRef = item.Attributes["href"].Name; } else { referenceAmount = new ReferenceAmount(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; Formula ob = Formula(); IDManager.SetID(formulaIDRef, ob); } else if (item.Attributes.ToString() == "href") { formulaIDRef = item.Attributes["href"].Name; } else { formula = new Formula(item); } } } XmlNodeList encodedDescriptionNodeList = xmlNode.SelectNodes("encodedDescription"); if (encodedDescriptionNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in encodedDescriptionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { encodedDescriptionIDRef = item.Attributes["id"].Name; XsdTypeBase64Binary ob = XsdTypeBase64Binary(); IDManager.SetID(encodedDescriptionIDRef, ob); } else if (item.Attributes.ToString() == "href") { encodedDescriptionIDRef = item.Attributes["href"].Name; } else { encodedDescription = new XsdTypeBase64Binary(item); } } } XmlNodeList calculationDatesNodeList = xmlNode.SelectNodes("calculationDates"); if (calculationDatesNodeList.Count > 1) { throw new Exception(); } foreach (XmlNode item in calculationDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationDatesIDRef = item.Attributes["id"].Name; AdjustableRelativeOrPeriodicDates ob = AdjustableRelativeOrPeriodicDates(); IDManager.SetID(calculationDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationDatesIDRef = item.Attributes["href"].Name; } else { calculationDates = new AdjustableRelativeOrPeriodicDates(item); } } } }
public LegAmount(XmlNode xmlNode) { XmlNode currencyNode = xmlNode.SelectSingleNode("currency"); if (currencyNode != null) { if (currencyNode.Attributes["href"] != null || currencyNode.Attributes["id"] != null) { if (currencyNode.Attributes["id"] != null) { currencyIDRef_ = currencyNode.Attributes["id"].Value; IdentifiedCurrency ob = new IdentifiedCurrency(currencyNode); IDManager.SetID(currencyIDRef_, ob); } else if (currencyNode.Attributes["href"] != null) { currencyIDRef_ = currencyNode.Attributes["href"].Value; } else { currency_ = new IdentifiedCurrency(currencyNode); } } else { currency_ = new IdentifiedCurrency(currencyNode); } } XmlNode determinationMethodNode = xmlNode.SelectSingleNode("determinationMethod"); if (determinationMethodNode != null) { if (determinationMethodNode.Attributes["href"] != null || determinationMethodNode.Attributes["id"] != null) { if (determinationMethodNode.Attributes["id"] != null) { determinationMethodIDRef_ = determinationMethodNode.Attributes["id"].Value; DeterminationMethod ob = new DeterminationMethod(determinationMethodNode); IDManager.SetID(determinationMethodIDRef_, ob); } else if (determinationMethodNode.Attributes["href"] != null) { determinationMethodIDRef_ = determinationMethodNode.Attributes["href"].Value; } else { determinationMethod_ = new DeterminationMethod(determinationMethodNode); } } else { determinationMethod_ = new DeterminationMethod(determinationMethodNode); } } XmlNode currencyReferenceNode = xmlNode.SelectSingleNode("currencyReference"); if (currencyReferenceNode != null) { if (currencyReferenceNode.Attributes["href"] != null || currencyReferenceNode.Attributes["id"] != null) { if (currencyReferenceNode.Attributes["id"] != null) { currencyReferenceIDRef_ = currencyReferenceNode.Attributes["id"].Value; IdentifiedCurrencyReference ob = new IdentifiedCurrencyReference(currencyReferenceNode); IDManager.SetID(currencyReferenceIDRef_, ob); } else if (currencyReferenceNode.Attributes["href"] != null) { currencyReferenceIDRef_ = currencyReferenceNode.Attributes["href"].Value; } else { currencyReference_ = new IdentifiedCurrencyReference(currencyReferenceNode); } } else { currencyReference_ = new IdentifiedCurrencyReference(currencyReferenceNode); } } XmlNode referenceAmountNode = xmlNode.SelectSingleNode("referenceAmount"); if (referenceAmountNode != null) { if (referenceAmountNode.Attributes["href"] != null || referenceAmountNode.Attributes["id"] != null) { if (referenceAmountNode.Attributes["id"] != null) { referenceAmountIDRef_ = referenceAmountNode.Attributes["id"].Value; ReferenceAmount ob = new ReferenceAmount(referenceAmountNode); IDManager.SetID(referenceAmountIDRef_, ob); } else if (referenceAmountNode.Attributes["href"] != null) { referenceAmountIDRef_ = referenceAmountNode.Attributes["href"].Value; } else { referenceAmount_ = new ReferenceAmount(referenceAmountNode); } } else { referenceAmount_ = new ReferenceAmount(referenceAmountNode); } } 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; Formula ob = new Formula(formulaNode); IDManager.SetID(formulaIDRef_, ob); } else if (formulaNode.Attributes["href"] != null) { formulaIDRef_ = formulaNode.Attributes["href"].Value; } else { formula_ = new Formula(formulaNode); } } else { formula_ = new Formula(formulaNode); } } XmlNode encodedDescriptionNode = xmlNode.SelectSingleNode("encodedDescription"); if (encodedDescriptionNode != null) { if (encodedDescriptionNode.Attributes["href"] != null || encodedDescriptionNode.Attributes["id"] != null) { if (encodedDescriptionNode.Attributes["id"] != null) { encodedDescriptionIDRef_ = encodedDescriptionNode.Attributes["id"].Value; XsdTypeBase64Binary ob = new XsdTypeBase64Binary(encodedDescriptionNode); IDManager.SetID(encodedDescriptionIDRef_, ob); } else if (encodedDescriptionNode.Attributes["href"] != null) { encodedDescriptionIDRef_ = encodedDescriptionNode.Attributes["href"].Value; } else { encodedDescription_ = new XsdTypeBase64Binary(encodedDescriptionNode); } } else { encodedDescription_ = new XsdTypeBase64Binary(encodedDescriptionNode); } } XmlNode calculationDatesNode = xmlNode.SelectSingleNode("calculationDates"); if (calculationDatesNode != null) { if (calculationDatesNode.Attributes["href"] != null || calculationDatesNode.Attributes["id"] != null) { if (calculationDatesNode.Attributes["id"] != null) { calculationDatesIDRef_ = calculationDatesNode.Attributes["id"].Value; AdjustableRelativeOrPeriodicDates ob = new AdjustableRelativeOrPeriodicDates(calculationDatesNode); IDManager.SetID(calculationDatesIDRef_, ob); } else if (calculationDatesNode.Attributes["href"] != null) { calculationDatesIDRef_ = calculationDatesNode.Attributes["href"].Value; } else { calculationDates_ = new AdjustableRelativeOrPeriodicDates(calculationDatesNode); } } else { calculationDates_ = new AdjustableRelativeOrPeriodicDates(calculationDatesNode); } } }
public LegAmount(XmlNode xmlNode) { XmlNodeList currencyNodeList = xmlNode.SelectNodes("currency"); if (currencyNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in currencyNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { currencyIDRef = item.Attributes["id"].Name; IdentifiedCurrency ob = IdentifiedCurrency(); IDManager.SetID(currencyIDRef, ob); } else if (item.Attributes.ToString() == "href") { currencyIDRef = item.Attributes["href"].Name; } else { currency = new IdentifiedCurrency(item); } } } XmlNodeList determinationMethodNodeList = xmlNode.SelectNodes("determinationMethod"); if (determinationMethodNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in determinationMethodNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { determinationMethodIDRef = item.Attributes["id"].Name; DeterminationMethod ob = DeterminationMethod(); IDManager.SetID(determinationMethodIDRef, ob); } else if (item.Attributes.ToString() == "href") { determinationMethodIDRef = item.Attributes["href"].Name; } else { determinationMethod = new DeterminationMethod(item); } } } XmlNodeList currencyReferenceNodeList = xmlNode.SelectNodes("currencyReference"); if (currencyReferenceNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in currencyReferenceNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { currencyReferenceIDRef = item.Attributes["id"].Name; IdentifiedCurrencyReference ob = IdentifiedCurrencyReference(); IDManager.SetID(currencyReferenceIDRef, ob); } else if (item.Attributes.ToString() == "href") { currencyReferenceIDRef = item.Attributes["href"].Name; } else { currencyReference = new IdentifiedCurrencyReference(item); } } } XmlNodeList referenceAmountNodeList = xmlNode.SelectNodes("referenceAmount"); if (referenceAmountNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in referenceAmountNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { referenceAmountIDRef = item.Attributes["id"].Name; ReferenceAmount ob = ReferenceAmount(); IDManager.SetID(referenceAmountIDRef, ob); } else if (item.Attributes.ToString() == "href") { referenceAmountIDRef = item.Attributes["href"].Name; } else { referenceAmount = new ReferenceAmount(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; Formula ob = Formula(); IDManager.SetID(formulaIDRef, ob); } else if (item.Attributes.ToString() == "href") { formulaIDRef = item.Attributes["href"].Name; } else { formula = new Formula(item); } } } XmlNodeList encodedDescriptionNodeList = xmlNode.SelectNodes("encodedDescription"); if (encodedDescriptionNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in encodedDescriptionNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { encodedDescriptionIDRef = item.Attributes["id"].Name; XsdTypeBase64Binary ob = XsdTypeBase64Binary(); IDManager.SetID(encodedDescriptionIDRef, ob); } else if (item.Attributes.ToString() == "href") { encodedDescriptionIDRef = item.Attributes["href"].Name; } else { encodedDescription = new XsdTypeBase64Binary(item); } } } XmlNodeList calculationDatesNodeList = xmlNode.SelectNodes("calculationDates"); if (calculationDatesNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in calculationDatesNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { calculationDatesIDRef = item.Attributes["id"].Name; AdjustableRelativeOrPeriodicDates ob = AdjustableRelativeOrPeriodicDates(); IDManager.SetID(calculationDatesIDRef, ob); } else if (item.Attributes.ToString() == "href") { calculationDatesIDRef = item.Attributes["href"].Name; } else { calculationDates = new AdjustableRelativeOrPeriodicDates(item); } } } }