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

📄 myxml.h

📁 Visual_C++.NET实用编程百例
💻 H
📖 第 1 页 / 共 3 页
字号:
    
    inline myXML::myXML(System::Runtime::Serialization::SerializationInfo *  info, System::Runtime::Serialization::StreamingContext context) {
        System::String *  strSchema = (__try_cast<System::String *  >(info->GetValue(S"XmlSchema", __typeof(System::String))));
        if ((strSchema != 0)) {
            System::Data::DataSet *  ds = new System::Data::DataSet();
            ds->ReadXmlSchema(new System::Xml::XmlTextReader(new System::IO::StringReader(strSchema)));
            if ((ds->Tables->Item[S"student"] != 0)) {
                this->Tables->Add(new CreatXML::myXML::studentDataTable(ds->Tables->Item[S"student"]));
            }
            if ((ds->Tables->Item[S"studentInfo"] != 0)) {
                this->Tables->Add(new CreatXML::myXML::studentInfoDataTable(ds->Tables->Item[S"studentInfo"]));
            }
            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->InitClass();
        }
        this->GetSerializationData(info, context);
        System::ComponentModel::CollectionChangeEventHandler *  schemaChangedHandler = new System::ComponentModel::CollectionChangeEventHandler(this, SchemaChanged);
        this->Tables->CollectionChanged += schemaChangedHandler;
        this->Relations->CollectionChanged += schemaChangedHandler;
    }
    
    inline CreatXML::myXML::studentDataTable *  myXML::get_student() {
        return this->tablestudent;
    }
    
    inline CreatXML::myXML::studentInfoDataTable *  myXML::get_studentInfo() {
        return this->tablestudentInfo;
    }
    
    inline System::Data::DataSet *  myXML::Clone() {
        CreatXML::myXML *  cln = (__try_cast<CreatXML::myXML *  >(__super::Clone()));
        cln->InitVars();
        return cln;
    };
    
    inline System::Boolean myXML::ShouldSerializeTables() {
        return false;
    };
    
    inline System::Boolean myXML::ShouldSerializeRelations() {
        return false;
    };
    
    inline System::Void myXML::ReadXmlSerializable(System::Xml::XmlReader *  reader) {
        this->Reset();
        System::Data::DataSet *  ds = new System::Data::DataSet();
        ds->ReadXml(reader);
        if ((ds->Tables->Item[S"student"] != 0)) {
            this->Tables->Add(new CreatXML::myXML::studentDataTable(ds->Tables->Item[S"student"]));
        }
        if ((ds->Tables->Item[S"studentInfo"] != 0)) {
            this->Tables->Add(new CreatXML::myXML::studentInfoDataTable(ds->Tables->Item[S"studentInfo"]));
        }
        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();
    };
    
    inline System::Xml::Schema::XmlSchema *  myXML::GetSchemaSerializable() {
        System::IO::MemoryStream *  stream = new System::IO::MemoryStream();
        this->WriteXmlSchema(new System::Xml::XmlTextWriter(stream, 0));
        stream->Position = 0;
        return System::Xml::Schema::XmlSchema::Read(new System::Xml::XmlTextReader(stream), 0);
    };
    
    inline System::Void myXML::InitVars() {
        this->tablestudent = (__try_cast<CreatXML::myXML::studentDataTable *  >(this->Tables->Item[S"student"]));
        if ((this->tablestudent != 0)) {
            this->tablestudent->InitVars();
        }
        this->tablestudentInfo = (__try_cast<CreatXML::myXML::studentInfoDataTable *  >(this->Tables->Item[S"studentInfo"]));
        if ((this->tablestudentInfo != 0)) {
            this->tablestudentInfo->InitVars();
        }
        this->relationstudent_studentInfo = this->Relations->Item[S"student_studentInfo"];
    };
    
    inline System::Void myXML::InitClass() {
        this->DataSetName = S"myXML";
        this->Prefix = S"";
        this->Namespace = S"http://tempuri.org/myXML.xsd";
        this->Locale = new System::Globalization::CultureInfo(S"en-US");
        this->CaseSensitive = false;
        this->EnforceConstraints = true;
        this->tablestudent = new CreatXML::myXML::studentDataTable();
        this->Tables->Add(this->tablestudent);
        this->tablestudentInfo = new CreatXML::myXML::studentInfoDataTable();
        this->Tables->Add(this->tablestudentInfo);
        System::Data::ForeignKeyConstraint *  fkc;
        System::Data::DataColumn* __mcTemp__1[] = new System::Data::DataColumn*[1];
                        __mcTemp__1[0] = this->tablestudent->student_IdColumn;
            System::Data::DataColumn* __mcTemp__2[] = new System::Data::DataColumn*[1];
                        __mcTemp__2[0] = this->tablestudentInfo->student_IdColumn;
        fkc = new System::Data::ForeignKeyConstraint(S"student_studentInfo", __mcTemp__1, __mcTemp__2);
        this->tablestudentInfo->Constraints->Add(fkc);
        fkc->AcceptRejectRule = System::Data::AcceptRejectRule::None;
        fkc->DeleteRule = System::Data::Rule::Cascade;
        fkc->UpdateRule = System::Data::Rule::Cascade;
        System::Data::DataColumn* __mcTemp__3[] = new System::Data::DataColumn*[1];
                        __mcTemp__3[0] = this->tablestudent->student_IdColumn;
            System::Data::DataColumn* __mcTemp__4[] = new System::Data::DataColumn*[1];
                        __mcTemp__4[0] = this->tablestudentInfo->student_IdColumn;
        this->relationstudent_studentInfo = new System::Data::DataRelation(S"student_studentInfo", __mcTemp__3, __mcTemp__4, false);
        this->relationstudent_studentInfo->Nested = true;
        this->Relations->Add(this->relationstudent_studentInfo);
    };
    
    inline System::Boolean myXML::ShouldSerializestudent() {
        return false;
    };
    
    inline System::Boolean myXML::ShouldSerializestudentInfo() {
        return false;
    };
    
    inline System::Void myXML::SchemaChanged(System::Object *  sender, System::ComponentModel::CollectionChangeEventArgs *  e) {
        if ((e->Action == System::ComponentModel::CollectionChangeAction::Remove)) {
            this->InitVars();
        }
    };
    
    
    
    
    
    
    inline myXML::studentDataTable::studentDataTable() : 
            DataTable(S"student") {
        this->InitClass();
    }
    
    inline myXML::studentDataTable::studentDataTable(System::Data::DataTable *  table) : 
            DataTable(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;
        this->DisplayExpression = table->DisplayExpression;
    }
    
    inline System::Int32 myXML::studentDataTable::get_Count() {
        return this->Rows->Count;
    }
    
    inline System::Data::DataColumn *  myXML::studentDataTable::get_studentNameColumn() {
        return this->columnstudentName;
    }
    
    inline System::Data::DataColumn *  myXML::studentDataTable::get_student_IdColumn() {
        return this->columnstudent_Id;
    }
    
    inline CreatXML::myXML::studentRow *  myXML::studentDataTable::get_Item(System::Int32 index) {
        return (__try_cast<CreatXML::myXML::studentRow *  >(this->Rows->Item[index]));
    }
    
    
    
    
    
    inline System::Void myXML::studentDataTable::AddstudentRow(CreatXML::myXML::studentRow *  row) {
        this->Rows->Add(row);
    };
    
    inline CreatXML::myXML::studentRow *  myXML::studentDataTable::AddstudentRow(System::String *  studentName) {
        CreatXML::myXML::studentRow *  rowstudentRow = (__try_cast<CreatXML::myXML::studentRow *  >(this->NewRow()));
        System::Object* __mcTemp__1[] = new System::Object*[2];
                __mcTemp__1[0] = studentName;
                __mcTemp__1[1] = 0;
        rowstudentRow->ItemArray = __mcTemp__1;
        this->Rows->Add(rowstudentRow);
        return rowstudentRow;
    };
    
    inline System::Collections::IEnumerator *  myXML::studentDataTable::GetEnumerator() {
        return this->Rows->GetEnumerator();
    };
    
    inline System::Data::DataTable *  myXML::studentDataTable::Clone() {
        CreatXML::myXML::studentDataTable *  cln = (__try_cast<CreatXML::myXML::studentDataTable *  >(__super::Clone()));
        cln->InitVars();
        return cln;
    };
    
    inline System::Data::DataTable *  myXML::studentDataTable::CreateInstance() {
        return new CreatXML::myXML::studentDataTable();
    };
    
    inline System::Void myXML::studentDataTable::InitVars() {
        this->columnstudentName = this->Columns->Item[S"studentName"];
        this->columnstudent_Id = this->Columns->Item[S"student_Id"];
    };
    
    inline System::Void myXML::studentDataTable::InitClass() {
        this->columnstudentName = new System::Data::DataColumn(S"studentName", __typeof(System::String), 0, System::Data::MappingType::Element);
        this->Columns->Add(this->columnstudentName);
        this->columnstudent_Id = new System::Data::DataColumn(S"student_Id", __typeof(System::Int32), 0, System::Data::MappingType::Hidden);
        this->Columns->Add(this->columnstudent_Id);
        System::Data::DataColumn* __mcTemp__1[] = new System::Data::DataColumn*[1];
                        __mcTemp__1[0] = this->columnstudent_Id;
        this->Constraints->Add(new System::Data::UniqueConstraint(S"Constraint1", __mcTemp__1, true));
        this->columnstudentName->AllowDBNull = false;
        this->columnstudent_Id->AutoIncrement = true;
        this->columnstudent_Id->AllowDBNull = false;
        this->columnstudent_Id->Unique = true;
    };
    
    inline CreatXML::myXML::studentRow *  myXML::studentDataTable::NewstudentRow() {
        return (__try_cast<CreatXML::myXML::studentRow *  >(this->NewRow()));
    };
    
    inline System::Data::DataRow *  myXML::studentDataTable::NewRowFromBuilder(System::Data::DataRowBuilder *  builder) {
        return new CreatXML::myXML::studentRow(builder);
    };
    
    inline System::Type *  myXML::studentDataTable::GetRowType() {
        return __typeof(CreatXML::myXML::studentRow);
    };
    
    inline System::Void myXML::studentDataTable::OnRowChanged(System::Data::DataRowChangeEventArgs *  e) {
        __super::OnRowChanged(e);
        if ((this->studentRowChanged != 0)) {
            this->studentRowChanged(this, new CreatXML::myXML::studentRowChangeEvent((__try_cast<CreatXML::myXML::studentRow *  >(e->Row)), e->Action));
        }
    };
    
    inline System::Void myXML::studentDataTable::OnRowChanging(System::Data::DataRowChangeEventArgs *  e) {
        __super::OnRowChanging(e);
        if ((this->studentRowChanging != 0)) {
            this->studentRowChanging(this, new CreatXML::myXML::studentRowChangeEvent((__try_cast<CreatXML::myXML::studentRow *  >(e->Row)), e->Action));
        }
    };
    
    inline System::Void myXML::studentDataTable::OnRowDeleted(System::Data::DataRowChangeEventArgs *  e) {
        __super::OnRowDeleted(e);
        if ((this->studentRowDeleted != 0)) {
            this->studentRowDeleted(this, new CreatXML::myXML::studentRowChangeEvent((__try_cast<CreatXML::myXML::studentRow *  >(e->Row)), e->Action));
        }
    };
    
    inline System::Void myXML::studentDataTable::OnRowDeleting(System::Data::DataRowChangeEventArgs *  e) {
        __super::OnRowDeleting(e);
        if ((this->studentRowDeleting != 0)) {
            this->studentRowDeleting(this, new CreatXML::myXML::studentRowChangeEvent((__try_cast<CreatXML::myXML::studentRow *  >(e->Row)), e->Action));
        }
    };
    
    inline System::Void myXML::studentDataTable::RemovestudentRow(CreatXML::myXML::studentRow *  row) {
        this->Rows->Remove(row);
    };
    
    
    

⌨️ 快捷键说明

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