示例#1
0
 private void InitClass()
 {
     base.DataSetName        = "GaugeData";
     base.Prefix             = "";
     base.Namespace          = "http://tempuri.org/GaugeData.xsd";
     base.EnforceConstraints = true;
     SchemaSerializationMode = SchemaSerializationMode.IncludeSchema;
     tableValues             = new ValuesDataTable();
     base.Tables.Add(tableValues);
 }
        public void SchemaSerializationModeTest()
        {
            AutoWebAgentDBDataSet   target   = new AutoWebAgentDBDataSet();   // TODO: Initialize to an appropriate value
            SchemaSerializationMode expected = new SchemaSerializationMode(); // TODO: Initialize to an appropriate value
            SchemaSerializationMode actual;

            target.SchemaSerializationMode = expected;
            actual = target.SchemaSerializationMode;
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
        //      Deserialize schema.
        private void DeserializeDataSetSchema(SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat, SchemaSerializationMode schemaSerializationMode) {
            if (remotingFormat != SerializationFormat.Xml) {
                if (schemaSerializationMode == SchemaSerializationMode.IncludeSchema) {
                    //DataSet public state properties
                    DeserializeDataSetProperties(info, context);

                    //Tables Count
                    int tableCount = info.GetInt32("DataSet.Tables.Count");

                    //Tables, Columns, Rows
                    for (int i = 0; i < tableCount; i++) {
                        Byte[] buffer = (Byte[])info.GetValue(String.Format(CultureInfo.InvariantCulture, "DataSet.Tables_{0}", i), typeof(Byte[]));
                        MemoryStream memStream = new MemoryStream(buffer);
                        memStream.Position = 0;
                        BinaryFormatter bf = new BinaryFormatter(null, new StreamingContext(context.State, false));
                        DataTable dt = (DataTable)bf.Deserialize(memStream);
                        Tables.Add(dt);
                    }

                    //Constraints
                    for (int i = 0; i < tableCount; i++) {
                        Tables[i].DeserializeConstraints(info, context,  /* table index */i,  /* serialize all constraints */ true); //
                    }

                    //Relations
                    DeserializeRelations(info, context);

                    //Expression Columns
                    for (int i = 0; i < tableCount; i++) {
                        Tables[i].DeserializeExpressionColumns(info, context, i);
                    }
                } else {
                    //DeSerialize DataSet public properties.[Locale, CaseSensitive and EnforceConstraints]
                    DeserializeDataSetProperties(info, context);
                }
            } else {
                string strSchema = (String)info.GetValue(KEY_XMLSCHEMA, typeof(System.String));

                if (strSchema != null) {
                    this.ReadXmlSchema(new XmlTextReader(new StringReader(strSchema)), true);
                }
            }
        }
 //      Deserialize all the tables - marked internal so that DataTable can call into this
 internal void DeserializeDataSet(SerializationInfo info, StreamingContext context, SerializationFormat remotingFormat, SchemaSerializationMode schemaSerializationMode) {
     // deserialize schema
     DeserializeDataSetSchema(info, context, remotingFormat, schemaSerializationMode);
     // deserialize data
     DeserializeDataSetData(info, context, remotingFormat);
 }
 public void SchemaSerializationModeTest()
 {
     taxi_managementDataSet target = new taxi_managementDataSet(); // TODO: Initialize to an appropriate value
     SchemaSerializationMode expected = new SchemaSerializationMode(); // TODO: Initialize to an appropriate value
     SchemaSerializationMode actual;
     target.SchemaSerializationMode = expected;
     actual = target.SchemaSerializationMode;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }