www.pudn.com > VMLForAspnet.rar > WorkFlow1.cs
//------------------------------------------------------------------------------ //// 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 VML.WorkFlow { using System; using System.Data; using System.Xml; using System.Runtime.Serialization; [Serializable()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Diagnostics.DebuggerStepThrough()] [System.ComponentModel.ToolboxItem(true)] public class WorkFlow : DataSet { private WorkFlowItemDataTable tableWorkFlowItem; private RelationDataTable tableRelation; public WorkFlow() { this.InitClass(); System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); this.Tables.CollectionChanged += schemaChangedHandler; this.Relations.CollectionChanged += schemaChangedHandler; } protected WorkFlow(SerializationInfo info, StreamingContext context) { string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string)))); if ((strSchema != null)) { DataSet ds = new DataSet(); ds.ReadXmlSchema(new XmlTextReader(new System.IO.StringReader(strSchema))); if ((ds.Tables["WorkFlowItem"] != null)) { this.Tables.Add(new WorkFlowItemDataTable(ds.Tables["WorkFlowItem"])); } if ((ds.Tables["Relation"] != null)) { this.Tables.Add(new RelationDataTable(ds.Tables["Relation"])); } 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; } [System.ComponentModel.Browsable(false)] [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)] public WorkFlowItemDataTable WorkFlowItem { get { return this.tableWorkFlowItem; } } [System.ComponentModel.Browsable(false)] [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)] public RelationDataTable Relation { get { return this.tableRelation; } } public override DataSet Clone() { WorkFlow cln = ((WorkFlow)(base.Clone())); cln.InitVars(); return cln; } protected override bool ShouldSerializeTables() { return false; } protected override bool ShouldSerializeRelations() { return false; } protected override void ReadXmlSerializable(XmlReader reader) { this.Reset(); DataSet ds = new DataSet(); ds.ReadXml(reader); if ((ds.Tables["WorkFlowItem"] != null)) { this.Tables.Add(new WorkFlowItemDataTable(ds.Tables["WorkFlowItem"])); } if ((ds.Tables["Relation"] != null)) { this.Tables.Add(new RelationDataTable(ds.Tables["Relation"])); } 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 XmlTextWriter(stream, null)); stream.Position = 0; return System.Xml.Schema.XmlSchema.Read(new XmlTextReader(stream), null); } internal void InitVars() { this.tableWorkFlowItem = ((WorkFlowItemDataTable)(this.Tables["WorkFlowItem"])); if ((this.tableWorkFlowItem != null)) { this.tableWorkFlowItem.InitVars(); } this.tableRelation = ((RelationDataTable)(this.Tables["Relation"])); if ((this.tableRelation != null)) { this.tableRelation.InitVars(); } } private void InitClass() { this.DataSetName = "WorkFlow"; this.Prefix = ""; this.Namespace = ""; this.Locale = new System.Globalization.CultureInfo("en-US"); this.CaseSensitive = false; this.EnforceConstraints = true; this.tableWorkFlowItem = new WorkFlowItemDataTable(); this.Tables.Add(this.tableWorkFlowItem); this.tableRelation = new RelationDataTable(); this.Tables.Add(this.tableRelation); } private bool ShouldSerializeWorkFlowItem() { return false; } private bool ShouldSerializeRelation() { return false; } private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) { if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) { this.InitVars(); } } public delegate void WorkFlowItemRowChangeEventHandler(object sender, WorkFlowItemRowChangeEvent e); public delegate void RelationRowChangeEventHandler(object sender, RelationRowChangeEvent e); [System.Diagnostics.DebuggerStepThrough()] public class WorkFlowItemDataTable : DataTable, System.Collections.IEnumerable { private DataColumn columnItemID; private DataColumn columnName; private DataColumn columnPosX; private DataColumn columnPosY; private DataColumn columnLimiteDate; private DataColumn columnisStart; internal WorkFlowItemDataTable() : base("WorkFlowItem") { this.InitClass(); } internal WorkFlowItemDataTable(DataTable table) : base(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; } [System.ComponentModel.Browsable(false)] public int Count { get { return this.Rows.Count; } } internal DataColumn ItemIDColumn { get { return this.columnItemID; } } internal DataColumn NameColumn { get { return this.columnName; } } internal DataColumn PosXColumn { get { return this.columnPosX; } } internal DataColumn PosYColumn { get { return this.columnPosY; } } internal DataColumn LimiteDateColumn { get { return this.columnLimiteDate; } } internal DataColumn isStartColumn { get { return this.columnisStart; } } public WorkFlowItemRow this[int index] { get { return ((WorkFlowItemRow)(this.Rows[index])); } } public event WorkFlowItemRowChangeEventHandler WorkFlowItemRowChanged; public event WorkFlowItemRowChangeEventHandler WorkFlowItemRowChanging; public event WorkFlowItemRowChangeEventHandler WorkFlowItemRowDeleted; public event WorkFlowItemRowChangeEventHandler WorkFlowItemRowDeleting; public void AddWorkFlowItemRow(WorkFlowItemRow row) { this.Rows.Add(row); } public WorkFlowItemRow AddWorkFlowItemRow(int ItemID, string Name, string PosX, string PosY, string LimiteDate, string isStart) { WorkFlowItemRow rowWorkFlowItemRow = ((WorkFlowItemRow)(this.NewRow())); rowWorkFlowItemRow.ItemArray = new object[] { ItemID, Name, PosX, PosY, LimiteDate, isStart}; this.Rows.Add(rowWorkFlowItemRow); return rowWorkFlowItemRow; } public System.Collections.IEnumerator GetEnumerator() { return this.Rows.GetEnumerator(); } public override DataTable Clone() { WorkFlowItemDataTable cln = ((WorkFlowItemDataTable)(base.Clone())); cln.InitVars(); return cln; } protected override DataTable CreateInstance() { return new WorkFlowItemDataTable(); } internal void InitVars() { this.columnItemID = this.Columns["ItemID"]; this.columnName = this.Columns["Name"]; this.columnPosX = this.Columns["PosX"]; this.columnPosY = this.Columns["PosY"]; this.columnLimiteDate = this.Columns["LimiteDate"]; this.columnisStart = this.Columns["isStart"]; } private void InitClass() { this.columnItemID = new DataColumn("ItemID", typeof(int), null, System.Data.MappingType.Element); this.Columns.Add(this.columnItemID); this.columnName = new DataColumn("Name", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columnName); this.columnPosX = new DataColumn("PosX", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columnPosX); this.columnPosY = new DataColumn("PosY", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columnPosY); this.columnLimiteDate = new DataColumn("LimiteDate", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columnLimiteDate); this.columnisStart = new DataColumn("isStart", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columnisStart); this.columnItemID.AllowDBNull = false; this.columnPosX.DefaultValue = "0"; this.columnPosY.DefaultValue = "0"; } public WorkFlowItemRow NewWorkFlowItemRow() { return ((WorkFlowItemRow)(this.NewRow())); } protected override DataRow NewRowFromBuilder(DataRowBuilder builder) { return new WorkFlowItemRow(builder); } protected override System.Type GetRowType() { return typeof(WorkFlowItemRow); } protected override void OnRowChanged(DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.WorkFlowItemRowChanged != null)) { this.WorkFlowItemRowChanged(this, new WorkFlowItemRowChangeEvent(((WorkFlowItemRow)(e.Row)), e.Action)); } } protected override void OnRowChanging(DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.WorkFlowItemRowChanging != null)) { this.WorkFlowItemRowChanging(this, new WorkFlowItemRowChangeEvent(((WorkFlowItemRow)(e.Row)), e.Action)); } } protected override void OnRowDeleted(DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.WorkFlowItemRowDeleted != null)) { this.WorkFlowItemRowDeleted(this, new WorkFlowItemRowChangeEvent(((WorkFlowItemRow)(e.Row)), e.Action)); } } protected override void OnRowDeleting(DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.WorkFlowItemRowDeleting != null)) { this.WorkFlowItemRowDeleting(this, new WorkFlowItemRowChangeEvent(((WorkFlowItemRow)(e.Row)), e.Action)); } } public void RemoveWorkFlowItemRow(WorkFlowItemRow row) { this.Rows.Remove(row); } } [System.Diagnostics.DebuggerStepThrough()] public class WorkFlowItemRow : DataRow { private WorkFlowItemDataTable tableWorkFlowItem; internal WorkFlowItemRow(DataRowBuilder rb) : base(rb) { this.tableWorkFlowItem = ((WorkFlowItemDataTable)(this.Table)); } public int ItemID { get { return ((int)(this[this.tableWorkFlowItem.ItemIDColumn])); } set { this[this.tableWorkFlowItem.ItemIDColumn] = value; } } public string Name { get { try { return ((string)(this[this.tableWorkFlowItem.NameColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("无法获取值,因为它是 DBNull。", e); } } set { this[this.tableWorkFlowItem.NameColumn] = value; } } public string PosX { get { if (this.IsPosXNull()) { return "0"; } else { return ((string)(this[this.tableWorkFlowItem.PosXColumn])); } } set { this[this.tableWorkFlowItem.PosXColumn] = value; } } public string PosY { get { if (this.IsPosYNull()) { return "0"; } else { return ((string)(this[this.tableWorkFlowItem.PosYColumn])); } } set { this[this.tableWorkFlowItem.PosYColumn] = value; } } public string LimiteDate { get { try { return ((string)(this[this.tableWorkFlowItem.LimiteDateColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("无法获取值,因为它是 DBNull。", e); } } set { this[this.tableWorkFlowItem.LimiteDateColumn] = value; } } public string isStart { get { try { return ((string)(this[this.tableWorkFlowItem.isStartColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("无法获取值,因为它是 DBNull。", e); } } set { this[this.tableWorkFlowItem.isStartColumn] = value; } } public bool IsNameNull() { return this.IsNull(this.tableWorkFlowItem.NameColumn); } public void SetNameNull() { this[this.tableWorkFlowItem.NameColumn] = System.Convert.DBNull; } public bool IsPosXNull() { return this.IsNull(this.tableWorkFlowItem.PosXColumn); } public void SetPosXNull() { this[this.tableWorkFlowItem.PosXColumn] = System.Convert.DBNull; } public bool IsPosYNull() { return this.IsNull(this.tableWorkFlowItem.PosYColumn); } public void SetPosYNull() { this[this.tableWorkFlowItem.PosYColumn] = System.Convert.DBNull; } public bool IsLimiteDateNull() { return this.IsNull(this.tableWorkFlowItem.LimiteDateColumn); } public void SetLimiteDateNull() { this[this.tableWorkFlowItem.LimiteDateColumn] = System.Convert.DBNull; } public bool IsisStartNull() { return this.IsNull(this.tableWorkFlowItem.isStartColumn); } public void SetisStartNull() { this[this.tableWorkFlowItem.isStartColumn] = System.Convert.DBNull; } } [System.Diagnostics.DebuggerStepThrough()] public class WorkFlowItemRowChangeEvent : EventArgs { private WorkFlowItemRow eventRow; private DataRowAction eventAction; public WorkFlowItemRowChangeEvent(WorkFlowItemRow row, DataRowAction action) { this.eventRow = row; this.eventAction = action; } public WorkFlowItemRow Row { get { return this.eventRow; } } public DataRowAction Action { get { return this.eventAction; } } } [System.Diagnostics.DebuggerStepThrough()] public class RelationDataTable : DataTable, System.Collections.IEnumerable { private DataColumn columnMasterItem; private DataColumn columnSecondItem; private DataColumn columnPoints; internal RelationDataTable() : base("Relation") { this.InitClass(); } internal RelationDataTable(DataTable table) : base(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; } [System.ComponentModel.Browsable(false)] public int Count { get { return this.Rows.Count; } } internal DataColumn MasterItemColumn { get { return this.columnMasterItem; } } internal DataColumn SecondItemColumn { get { return this.columnSecondItem; } } internal DataColumn PointsColumn { get { return this.columnPoints; } } public RelationRow this[int index] { get { return ((RelationRow)(this.Rows[index])); } } public event RelationRowChangeEventHandler RelationRowChanged; public event RelationRowChangeEventHandler RelationRowChanging; public event RelationRowChangeEventHandler RelationRowDeleted; public event RelationRowChangeEventHandler RelationRowDeleting; public void AddRelationRow(RelationRow row) { this.Rows.Add(row); } public RelationRow AddRelationRow(int MasterItem, int SecondItem, string Points) { RelationRow rowRelationRow = ((RelationRow)(this.NewRow())); rowRelationRow.ItemArray = new object[] { MasterItem, SecondItem, Points}; this.Rows.Add(rowRelationRow); return rowRelationRow; } public System.Collections.IEnumerator GetEnumerator() { return this.Rows.GetEnumerator(); } public override DataTable Clone() { RelationDataTable cln = ((RelationDataTable)(base.Clone())); cln.InitVars(); return cln; } protected override DataTable CreateInstance() { return new RelationDataTable(); } internal void InitVars() { this.columnMasterItem = this.Columns["MasterItem"]; this.columnSecondItem = this.Columns["SecondItem"]; this.columnPoints = this.Columns["Points"]; } private void InitClass() { this.columnMasterItem = new DataColumn("MasterItem", typeof(int), null, System.Data.MappingType.Element); this.Columns.Add(this.columnMasterItem); this.columnSecondItem = new DataColumn("SecondItem", typeof(int), null, System.Data.MappingType.Element); this.Columns.Add(this.columnSecondItem); this.columnPoints = new DataColumn("Points", typeof(string), null, System.Data.MappingType.Element); this.Columns.Add(this.columnPoints); this.columnMasterItem.AllowDBNull = false; this.columnSecondItem.AllowDBNull = false; } public RelationRow NewRelationRow() { return ((RelationRow)(this.NewRow())); } protected override DataRow NewRowFromBuilder(DataRowBuilder builder) { return new RelationRow(builder); } protected override System.Type GetRowType() { return typeof(RelationRow); } protected override void OnRowChanged(DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.RelationRowChanged != null)) { this.RelationRowChanged(this, new RelationRowChangeEvent(((RelationRow)(e.Row)), e.Action)); } } protected override void OnRowChanging(DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.RelationRowChanging != null)) { this.RelationRowChanging(this, new RelationRowChangeEvent(((RelationRow)(e.Row)), e.Action)); } } protected override void OnRowDeleted(DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.RelationRowDeleted != null)) { this.RelationRowDeleted(this, new RelationRowChangeEvent(((RelationRow)(e.Row)), e.Action)); } } protected override void OnRowDeleting(DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.RelationRowDeleting != null)) { this.RelationRowDeleting(this, new RelationRowChangeEvent(((RelationRow)(e.Row)), e.Action)); } } public void RemoveRelationRow(RelationRow row) { this.Rows.Remove(row); } } [System.Diagnostics.DebuggerStepThrough()] public class RelationRow : DataRow { private RelationDataTable tableRelation; internal RelationRow(DataRowBuilder rb) : base(rb) { this.tableRelation = ((RelationDataTable)(this.Table)); } public int MasterItem { get { return ((int)(this[this.tableRelation.MasterItemColumn])); } set { this[this.tableRelation.MasterItemColumn] = value; } } public int SecondItem { get { return ((int)(this[this.tableRelation.SecondItemColumn])); } set { this[this.tableRelation.SecondItemColumn] = value; } } public string Points { get { try { return ((string)(this[this.tableRelation.PointsColumn])); } catch (InvalidCastException e) { throw new StrongTypingException("无法获取值,因为它是 DBNull。", e); } } set { this[this.tableRelation.PointsColumn] = value; } } public bool IsPointsNull() { return this.IsNull(this.tableRelation.PointsColumn); } public void SetPointsNull() { this[this.tableRelation.PointsColumn] = System.Convert.DBNull; } } [System.Diagnostics.DebuggerStepThrough()] public class RelationRowChangeEvent : EventArgs { private RelationRow eventRow; private DataRowAction eventAction; public RelationRowChangeEvent(RelationRow row, DataRowAction action) { this.eventRow = row; this.eventAction = action; } public RelationRow Row { get { return this.eventRow; } } public DataRowAction Action { get { return this.eventAction; } } } } }