⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 product.cs

📁 C#高级编程第四版 第十九章源代码 敬请下载
💻 CS
📖 第 1 页 / 共 4 页
字号:
//------------------------------------------------------------------------------
// <autogenerated>
//     This code was generated by a tool.
//     Runtime Version:2.0.40426.16
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------

using System;

// 
// This source code was auto-generated by xsd, Version=2.0.40426.16.
// 


[Serializable()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Diagnostics.DebuggerStepThrough()]
[System.ComponentModel.ToolboxItem(true)]
[System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
[System.Xml.Serialization.XmlRootAttribute("Products")]
public partial class Products : System.Data.DataSet {
    
    private ProductDataTable tableProduct;
    
    public Products() {
        this.BeginInit();
        this.InitClass();
        System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
        base.Tables.CollectionChanged += schemaChangedHandler;
        base.Relations.CollectionChanged += schemaChangedHandler;
        this.EndInit();
    }
    
    protected Products(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : 
            base(info, context) {
        if ((this.IsBinarySerialized(info, context) == true)) {
            this.InitVars(false);
            System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
            this.Tables.CollectionChanged += schemaChangedHandler1;
            this.Relations.CollectionChanged += schemaChangedHandler1;
            return;
        }
        string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
        if ((strSchema != null)) {
            System.Data.DataSet ds = new System.Data.DataSet();
            ds.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
            if ((ds.Tables["Product"] != null)) {
                base.Tables.Add(new ProductDataTable(ds.Tables["Product"]));
            }
            this.DataSetName = ds.DataSetName;
            this.Prefix = ds.Prefix;
            this.Namespace = ds.Namespace;
            this.Locale = ds.Locale;
            this.CaseSensitive = ds.CaseSensitive;
            this.EnforceConstraints = ds.EnforceConstraints;
            this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
            this.InitVars();
        }
        else {
            this.BeginInit();
            this.InitClass();
            this.EndInit();
        }
        this.GetSerializationData(info, context);
        System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
        base.Tables.CollectionChanged += schemaChangedHandler;
        this.Relations.CollectionChanged += schemaChangedHandler;
    }
    
    [System.ComponentModel.Browsable(false)]
    public ProductDataTable Product {
        get {
            return this.tableProduct;
        }
    }
    
    [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
    public new System.Data.DataTableCollection Tables {
        get {
            return base.Tables;
        }
    }
    
    [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
    public new System.Data.DataRelationCollection Relations {
        get {
            return base.Relations;
        }
    }
    
    [System.ComponentModel.DefaultValueAttribute(true)]
    public new bool EnforceConstraints {
        get {
            return base.EnforceConstraints;
        }
        set {
            base.EnforceConstraints = value;
        }
    }
    
    public override System.Data.DataSet Clone() {
        Products cln = ((Products)(base.Clone()));
        cln.InitVars();
        return cln;
    }
    
    protected override bool ShouldSerializeTables() {
        return false;
    }
    
    protected override bool ShouldSerializeRelations() {
        return false;
    }
    
    protected override void ReadXmlSerializable(System.Xml.XmlReader reader) {
        this.Reset();
        System.Data.DataSet ds = new System.Data.DataSet();
        ds.ReadXml(reader);
        if ((ds.Tables["Product"] != null)) {
            base.Tables.Add(new ProductDataTable(ds.Tables["Product"]));
        }
        this.DataSetName = ds.DataSetName;
        this.Prefix = ds.Prefix;
        this.Namespace = ds.Namespace;
        this.Locale = ds.Locale;
        this.CaseSensitive = ds.CaseSensitive;
        this.EnforceConstraints = ds.EnforceConstraints;
        this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
        this.InitVars();
    }
    
    protected override System.Xml.Schema.XmlSchema GetSchemaSerializable() {
        System.IO.MemoryStream stream = new System.IO.MemoryStream();
        this.WriteXmlSchema(new System.Xml.XmlTextWriter(stream, null));
        stream.Position = 0;
        return System.Xml.Schema.XmlSchema.Read(new System.Xml.XmlTextReader(stream), null);
    }
    
    internal void InitVars() {
        this.InitVars(true);
    }
    
    internal void InitVars(bool initTable) {
        this.tableProduct = ((ProductDataTable)(base.Tables["Product"]));
        if ((initTable == true)) {
            if ((this.tableProduct != null)) {
                this.tableProduct.InitVars();
            }
        }
    }
    
    private void InitClass() {
        this.DataSetName = "Products";
        this.Prefix = "";
        this.Namespace = "";
        this.Locale = new System.Globalization.CultureInfo("en-US");
        this.CaseSensitive = false;
        this.EnforceConstraints = true;
        this.tableProduct = new ProductDataTable();
        base.Tables.Add(this.tableProduct);
        this.ExtendedProperties.Add("DSGenerator_DataSetName", "Products");
        this.ExtendedProperties.Add("User_DataSetName", "Products");
    }
    
    private bool ShouldSerializeProduct() {
        return false;
    }
    
    private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
        if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
            this.InitVars();
        }
    }
    
    public static System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(System.Xml.Schema.XmlSchemaSet xs) {
        Products ds = new Products();
        System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
        System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
        xs.Add(ds.GetSchemaSerializable());
        if (PublishLegacyWSDL()) {
            System.Xml.Schema.XmlSchemaAny any = new System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
        }
        else {
            System.Xml.Schema.XmlSchemaAny any1 = new System.Xml.Schema.XmlSchemaAny();
            any1.Namespace = "http://www.w3.org/2001/XMLSchema";
            any1.MinOccurs = new System.Decimal(0);
            any1.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
            sequence.Items.Add(any1);
            System.Xml.Schema.XmlSchemaAny any2 = new System.Xml.Schema.XmlSchemaAny();
            any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
            any2.MinOccurs = new System.Decimal(0);
            any2.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
            sequence.Items.Add(any2);
            sequence.MaxOccurs = System.Decimal.MaxValue;
            System.Xml.Schema.XmlSchemaAttribute attribute = new System.Xml.Schema.XmlSchemaAttribute();
            attribute.Name = "namespace";
            attribute.FixedValue = ds.Namespace;
            type.Attributes.Add(attribute);
        }
        type.Particle = sequence;
        return type;
    }
    
    protected static bool PublishLegacyWSDL() {
        System.Collections.Specialized.NameValueCollection settings = ((System.Collections.Specialized.NameValueCollection)(System.Configuration.ConfigurationSettings.GetConfig("system.data.dataset")));
        if ((settings != null)) {
            string[] values = settings.GetValues("WSDL_VERSION");
            if ((values != null)) {
                float version = float.Parse(((string)(values[0])), ((System.IFormatProvider)(null)));
                return (version < 2);
            }
        }
        return true;
    }
    
    public delegate void ProductRowChangeEventHandler(object sender, ProductRowChangeEvent e);
    
    [System.Serializable()]
    [System.Diagnostics.DebuggerStepThrough()]
    [System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
    public partial class ProductDataTable : System.Data.DataTable, System.Collections.IEnumerable {
        
        private System.Data.DataColumn columnProductID;
        
        private System.Data.DataColumn columnProductName;
        
        private System.Data.DataColumn columnSupplierID;
        
        private System.Data.DataColumn columnCategoryID;
        
        private System.Data.DataColumn columnQuantityPerUnit;
        
        private System.Data.DataColumn columnUnitPrice;
        
        private System.Data.DataColumn columnUnitsInStock;
        
        private System.Data.DataColumn columnUnitsOnOrder;
        
        private System.Data.DataColumn columnReorderLevel;
        
        private System.Data.DataColumn columnDiscontinued;
        
        private bool m_suspendValidation = false;
        
        public ProductDataTable() {
            this.TableName = "Product";
            this.BeginInit();
            this.InitClass();
            this.EndInit();
        }
        
        internal ProductDataTable(System.Data.DataTable table) {
            this.TableName = table.TableName;
            if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
                this.CaseSensitive = table.CaseSensitive;
            }
            if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
                this.Locale = table.Locale;
            }
            if ((table.Namespace != table.DataSet.Namespace)) {
                this.Namespace = table.Namespace;
            }
            this.Prefix = table.Prefix;
            this.MinimumCapacity = table.MinimumCapacity;
        }
        
        protected ProductDataTable(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : 
                base(info, context) {
            this.InitVars();
        }
        
        internal System.Data.DataColumn ProductIDColumn {
            get {
                return this.columnProductID;
            }
        }
        
        internal System.Data.DataColumn ProductNameColumn {
            get {
                return this.columnProductName;
            }
        }
        
        internal System.Data.DataColumn SupplierIDColumn {
            get {
                return this.columnSupplierID;
            }
        }
        
        internal System.Data.DataColumn CategoryIDColumn {
            get {
                return this.columnCategoryID;
            }
        }
        
        internal System.Data.DataColumn QuantityPerUnitColumn {
            get {
                return this.columnQuantityPerUnit;
            }
        }
        
        internal System.Data.DataColumn UnitPriceColumn {
            get {
                return this.columnUnitPrice;
            }
        }
        
        internal System.Data.DataColumn UnitsInStockColumn {
            get {
                return this.columnUnitsInStock;
            }
        }
        
        internal System.Data.DataColumn UnitsOnOrderColumn {
            get {
                return this.columnUnitsOnOrder;
            }
        }
        
        internal System.Data.DataColumn ReorderLevelColumn {
            get {
                return this.columnReorderLevel;
            }
        }
        
        internal System.Data.DataColumn DiscontinuedColumn {
            get {
                return this.columnDiscontinued;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -