//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version: 1.1.4322.573 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace Dell.Bing { using System; using System.Xml; public class Product : ProductType { } public class ProductType { private int m_number; private HowBig m_howBig; private System.Decimal m_size; private int m_height; private AnotherHowBig m_anotherHowBig; private System.Decimal m_anotherSize; private int m_anotherHeight; private AddressType m_address; private System.DateTime m_effDate; public int Number { get { return m_number; } set { this.m_number = value; } } public HowBig HowBigSetting { get { return this.m_howBig; } } public System.Decimal Size { get { if ((this.m_howBig != HowBig.size)) { throw new System.InvalidOperationException("This request is only valid when HowBigSetting is set to HowBig.size"); } return m_size; } set { this.AssertSizeType(value); this.m_howBig = HowBig.size; this.m_size = value; } } public int Height { get { if ((this.m_howBig != HowBig.height)) { throw new System.InvalidOperationException("This request is only valid when HowBigSetting is set to HowBig.height"); } return m_height; } set { this.m_howBig = HowBig.height; this.m_height = value; } } public AnotherHowBig AnotherHowBigSetting { get { return this.m_anotherHowBig; } } public System.Decimal AnotherSize { get { if ((this.m_anotherHowBig != AnotherHowBig.anotherSize)) { throw new System.InvalidOperationException("This request is only valid when AnotherHowBigSetting is set to AnotherHowBig.anot" + "herSize"); } return m_anotherSize; } set { this.AssertSizeType(value); this.m_anotherHowBig = AnotherHowBig.anotherSize; this.m_anotherSize = value; } } public int AnotherHeight { get { if ((this.m_anotherHowBig != AnotherHowBig.anotherHeight)) { throw new System.InvalidOperationException("This request is only valid when AnotherHowBigSetting is set to AnotherHowBig.anot" + "herHeight"); } return m_anotherHeight; } set { this.m_anotherHowBig = AnotherHowBig.anotherHeight; this.m_anotherHeight = value; } } public AddressType Address { get { return m_address; } set { this.m_address = value; } } public System.DateTime EffDate { get { return m_effDate; } set { this.m_effDate = value; } } public bool IsValidSizeType(System.Decimal value) { return ((value >= 2) && (value <= 18)); } public void AssertSizeType(System.Decimal value) { if ((this.IsValidSizeType(value) == false)) { throw new System.ArgumentException("value"); } } public enum HowBig { size = 1, height = 2, } public enum AnotherHowBig { anotherSize = 1, anotherHeight = 2, } public class AddressType { private string m_street; private string m_street2; private string m_city; private string m_state; private string m_zipCode; private static System.Text.RegularExpressions.Regex g_regex1 = new System.Text.RegularExpressions.Regex("[0-9]{5}(-[0-9]{4})?"); public string Street { get { return m_street; } set { this.m_street = value; } } public string Street2 { get { return m_street2; } set { this.m_street2 = value; } } public string City { get { return m_city; } set { this.m_city = value; } } public string State { get { return m_state; } set { this.m_state = value; } } public string ZipCode { get { return m_zipCode; } set { this.Assert(value); this.m_zipCode = value; } } public bool IsValid(string value) { return AddressType.g_regex1.IsMatch(value.ToString()); } public void Assert(string value) { if ((this.IsValid(value) == false)) { throw new System.ArgumentException("value"); } } } } }