From 921efd82736e10ea9ec81e80b7f91570731f11b5 Mon Sep 17 00:00:00 2001 From: kimikage Date: Mon, 13 Dec 2010 02:07:00 +0900 Subject: [PATCH] =?utf8?q?CsvReader=E3=81=AE=E3=83=91=E3=83=BC=E3=82=B5?= =?utf8?q?=E8=BF=BD=E5=8A=A0=EF=BC=8C=E3=83=97=E3=83=AD=E3=83=88=E3=82=BF?= =?utf8?q?=E3=82=A4=E3=83=97=E6=8C=87=E5=AE=9A=E3=83=BB=E5=9E=8B=E5=BC=95?= =?utf8?q?=E6=95=B0=E7=9C=81=E7=95=A5=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Karinto/CsvReader.cs | 260 +++++++---- Karinto/Karinto.csproj | 1 - Karinto/Xml/Data.Designer.cs | 1010 ++++++++++++++++++++++++++++++++++-------- Karinto/Xml/Data.xsd | 31 +- Karinto/Xml/Data.xss | 10 +- KarintoTest/CsvReaderTest.cs | 38 +- 6 files changed, 1057 insertions(+), 293 deletions(-) diff --git a/Karinto/CsvReader.cs b/Karinto/CsvReader.cs index c8a131c..bc1b291 100755 --- a/Karinto/CsvReader.cs +++ b/Karinto/CsvReader.cs @@ -14,16 +14,28 @@ using System.Data; namespace Karinto { + public class CsvReader : CsvReader + { + private CsvReader() + { + } + + public CsvReader(DataTable prototype) + : base(prototype) + { + } + } + public class CsvReader where TDataTable : DataTable, new() { #region private fields private string separator; private Regex sepPattern; - private TDataTable protoType; + private TDataTable prototype; private DataColumnCollection cols; - - private delegate bool Parser(ref string input, out object output); + + public delegate bool Parser(ref string input, out object output); static private Dictionary parsers; private Parser[] lineParser; @@ -31,24 +43,38 @@ namespace Karinto #region constructors static CsvReader() - { + { parsers = new Dictionary(); + parsers[typeof(Boolean)] = ParseBoolean; parsers[typeof(Double)] = ParseDouble; + parsers[typeof(Single)] = ParseSingle; + parsers[typeof(Decimal)] = ParseDecimal; + parsers[typeof(Int32)] = ParseInt32; + parsers[typeof(Int64)] = ParseInt64; } public CsvReader() + : this(new TDataTable()) + { + } + + public CsvReader(TDataTable prototype) { Separator = @","; - protoType = new TDataTable(); - cols = protoType.Columns; + this.prototype = (TDataTable)prototype.Clone(); + cols = prototype.Columns; lineParser = new Parser[cols.Count]; - for(int i = 0; i < cols.Count; ++i) + for (int i = 0; i < cols.Count; ++i) { Type t = cols[i].DataType; if (parsers[t] != null) { lineParser[i] = parsers[t]; } + else if (t == typeof(DateTime)) + { + lineParser[i] = ParseDateTime; + } else { lineParser[i] = ParseString; @@ -58,11 +84,11 @@ namespace Karinto #endregion #region properties - + /// /// 区切り文字 /// - public string Separator + public string Separator { get { @@ -81,7 +107,7 @@ namespace Karinto public TDataTable Read(FilePath path) { - TDataTable table = new TDataTable(); + TDataTable table = (TDataTable)prototype.Clone(); try { using (FileStream fs = new FileStream( @@ -116,9 +142,52 @@ namespace Karinto public TDataTable ReadAll(FilePath path) { + throw new NotImplementedException(); return null; } + public Parser GetParser(int column) + { + return lineParser[column]; + } + + public Parser GetParser(string column) + { + return lineParser[prototype.Columns.IndexOf(column)]; + } + + public Parser GetParser(DataColumn column) + { + return lineParser[prototype.Columns.IndexOf(column.ColumnName)]; + } + + static public Parser GetParser(Type type) + { + return parsers[type]; + } + + public void SetParser(int column, Parser parser) + { + lineParser[column] = parser; + } + + public void SetParser(string column, Parser parser) + { + lineParser[prototype.Columns.IndexOf(column)] = parser; + } + + public void SetParser(DataColumn column, Parser parser) + { + lineParser[prototype.Columns.IndexOf(column.ColumnName)] = parser; + } + + static public void SetParser(Type type, Parser parser) + { + parsers[type] = parser; + } + + + #endregion #region private methods @@ -126,7 +195,7 @@ namespace Karinto private void SetRow(DataRow row, string line) { for (int i = 0; i < lineParser.Length; ++i) - { + { object value; if (lineParser[i](ref line, out value)) { @@ -151,7 +220,7 @@ namespace Karinto { string name = value as string; Match comment = Regex.Match(name, @"^#\s*"); - columns[i].ColumnName = name.Substring(comment.Length); + columns[i].Caption = name.Substring(comment.Length); } else { @@ -162,6 +231,27 @@ namespace Karinto } } + #region parsers + + static private bool ParseBoolean(ref string input, out object output) + { + Match m = Regex.Match(input, + "^" + Boolean.TrueString, RegexOptions.IgnoreCase); + if (!m.Success) + { + m = Regex.Match(input, + "^" + Boolean.FalseString, RegexOptions.IgnoreCase); + if (!m.Success) + { + output = false; + return false; + } + } + output = true; + input = input.Substring(m.Length); + return true; + } + static private bool ParseDouble(ref string input, out object output) { Match m = RegexSet.DecimalFloat.Match(input); @@ -175,6 +265,72 @@ namespace Karinto return true; } + static private bool ParseSingle(ref string input, out object output) + { + Match m = RegexSet.DecimalFloat.Match(input); + if (!m.Success) + { + output = 0; + return false; + } + output = Single.Parse(m.Groups[1].Value); + input = input.Substring(m.Length); + return true; + } + + static private bool ParseDecimal(ref string input, out object output) + { + Match m = RegexSet.DecimalFloat.Match(input); + if (!m.Success) + { + output = 0; + return false; + } + output = Decimal.Parse(m.Groups[1].Value); + input = input.Substring(m.Length); + return true; + } + + static private bool ParseInt32(ref string input, out object output) + { + Match m = RegexSet.DecimalFloat.Match(input); + if (!m.Success) + { + output = 0; + return false; + } + output = (Int32)Double.Parse(m.Groups[1].Value); + input = input.Substring(m.Length); + return true; + } + + static private bool ParseInt64(ref string input, out object output) + { + Match m = RegexSet.DecimalFloat.Match(input); + if (!m.Success) + { + output = 0; + return false; + } + output = (Int64)Double.Parse(m.Groups[1].Value); + input = input.Substring(m.Length); + return true; + } + + private bool ParseDateTime(ref string input, out object output) + { + object value; + ParseString(ref input, out value); + DateTime dt; + if (DateTime.TryParse(value as string, out dt)) + { + output = dt; + return true; + } + output = DBNull.Value; + return false; + } + private bool ParseString(ref string input, out object output) { Match quotedMatch = RegexSet.QuotedString.Match(input); @@ -199,86 +355,8 @@ namespace Karinto } return true; } + #endregion #endregion } - - /* - public class CsvReader where TDataSet : IDataSet, new() - { - private string separator = ","; - - - - /// - /// CSVファイルを読み込む - /// - /// CSVファイルのパス - /// 行の雛型 - /// 指定した型のリスト - public List Read(FilePath path) - { - return Read(path, new TDataSet()); - } - - /// - /// 雛型を指定してCSVファイルを読み込む - /// - /// CSVファイルのパス - /// 行の雛型 - /// 指定した型のリスト - public List Read(FilePath path, TDataSet proto) - { - List records = new List(); - - string line = ""; - // 数値にマッチする正規表現 - //string regex = @"\s*" + RegexSet.DecimalFloat + @"\s*" + separator; - string regex = @"\s*" + @"(?<1>([-+]?(\d+([\.,]\d*)?|([\.,]\d+))([eE][-+]?\d+)?))" + @"\s*" + separator; - Regex rCsv = new Regex(regex, RegexOptions.Compiled); - - try - { - using (FileStream fs = new FileStream( - path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) - { - using (StreamReader reader = new StreamReader(fs)) - { - while (reader.Peek() >= 0) - { - line = reader.ReadLine() + separator; - //Console.WriteLine("> " + line); - MatchCollection mc = rCsv.Matches(line); - - // 現状ではNaNが含まれる行は受理しない - if (!proto.Width.Includes(mc.Count)) continue; - - if (proto.KeyRange != null) - { - double key = Double.Parse(mc[0].Groups[1].Value); - if (!proto.KeyRange.Includes(key)) continue; - } - - TDataSet c = new TDataSet(); - foreach (Match m in mc) - { - c.Push(Double.Parse(m.Groups[1].Value)); - } - records.Add(c); - } - } - } - } - catch (Exception e) - { - Console.WriteLine("The file could not be read:"); - Console.WriteLine("> " + path); - Console.WriteLine(e.Message); - throw e; - } - - return records; - } - - }*/ } diff --git a/Karinto/Karinto.csproj b/Karinto/Karinto.csproj index 7c351e3..0c5aca4 100755 --- a/Karinto/Karinto.csproj +++ b/Karinto/Karinto.csproj @@ -55,7 +55,6 @@ - diff --git a/Karinto/Xml/Data.Designer.cs b/Karinto/Xml/Data.Designer.cs index 6324ea3..9769f88 100755 --- a/Karinto/Xml/Data.Designer.cs +++ b/Karinto/Xml/Data.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // このコードはツールによって生成されました。 -// ランタイム バージョン:2.0.50727.3615 +// ランタイム バージョン:2.0.50727.4952 // // このファイルへの変更は、以下の状況下で不正な動作の原因になったり、 // コードが再生成されるときに損失したりします。 @@ -31,6 +31,10 @@ namespace Karinto.Xml { private XY1ChDataTable tableXY1Ch; + private TimeFunction1ChDataTable tableTimeFunction1Ch; + + private TimeFunction2ChDataTable tableTimeFunction2Ch; + private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -66,6 +70,12 @@ namespace Karinto.Xml { if ((ds.Tables["XY1Ch"] != null)) { base.Tables.Add(new XY1ChDataTable(ds.Tables["XY1Ch"])); } + if ((ds.Tables["TimeFunction1Ch"] != null)) { + base.Tables.Add(new TimeFunction1ChDataTable(ds.Tables["TimeFunction1Ch"])); + } + if ((ds.Tables["TimeFunction2Ch"] != null)) { + base.Tables.Add(new TimeFunction2ChDataTable(ds.Tables["TimeFunction2Ch"])); + } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; @@ -112,6 +122,24 @@ namespace Karinto.Xml { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public TimeFunction1ChDataTable TimeFunction1Ch { + get { + return this.tableTimeFunction1Ch; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] + public TimeFunction2ChDataTable TimeFunction2Ch { + get { + return this.tableTimeFunction2Ch; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.ComponentModel.BrowsableAttribute(true)] [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)] public override global::System.Data.SchemaSerializationMode SchemaSerializationMode { @@ -179,6 +207,12 @@ namespace Karinto.Xml { if ((ds.Tables["XY1Ch"] != null)) { base.Tables.Add(new XY1ChDataTable(ds.Tables["XY1Ch"])); } + if ((ds.Tables["TimeFunction1Ch"] != null)) { + base.Tables.Add(new TimeFunction1ChDataTable(ds.Tables["TimeFunction1Ch"])); + } + if ((ds.Tables["TimeFunction2Ch"] != null)) { + base.Tables.Add(new TimeFunction2ChDataTable(ds.Tables["TimeFunction2Ch"])); + } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; @@ -227,6 +261,18 @@ namespace Karinto.Xml { this.tableXY1Ch.InitVars(); } } + this.tableTimeFunction1Ch = ((TimeFunction1ChDataTable)(base.Tables["TimeFunction1Ch"])); + if ((initTable == true)) { + if ((this.tableTimeFunction1Ch != null)) { + this.tableTimeFunction1Ch.InitVars(); + } + } + this.tableTimeFunction2Ch = ((TimeFunction2ChDataTable)(base.Tables["TimeFunction2Ch"])); + if ((initTable == true)) { + if ((this.tableTimeFunction2Ch != null)) { + this.tableTimeFunction2Ch.InitVars(); + } + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -243,6 +289,10 @@ namespace Karinto.Xml { base.Tables.Add(this.tableXY2Ch); this.tableXY1Ch = new XY1ChDataTable(); base.Tables.Add(this.tableXY1Ch); + this.tableTimeFunction1Ch = new TimeFunction1ChDataTable(); + base.Tables.Add(this.tableTimeFunction1Ch); + this.tableTimeFunction2Ch = new TimeFunction2ChDataTable(); + base.Tables.Add(this.tableTimeFunction2Ch); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -261,6 +311,16 @@ namespace Karinto.Xml { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + private bool ShouldSerializeTimeFunction1Ch() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + private bool ShouldSerializeTimeFunction2Ch() { + return false; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) { if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) { this.InitVars(); @@ -319,6 +379,10 @@ namespace Karinto.Xml { public delegate void XY1ChRowChangeEventHandler(object sender, XY1ChRowChangeEvent e); + public delegate void TimeFunction1ChRowChangeEventHandler(object sender, TimeFunction1ChRowChangeEvent e); + + public delegate void TimeFunction2ChRowChangeEventHandler(object sender, TimeFunction2ChRowChangeEvent e); + /// ///Represents the strongly named DataTable class. /// @@ -702,6 +766,12 @@ namespace Karinto.Xml { base.Columns.Add(this.columnY1); this.columnY2 = new global::System.Data.DataColumn("Y2", typeof(double), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnY2); + this.columnX.AllowDBNull = false; + this.columnX.DefaultValue = ((double)(0)); + this.columnY1.AllowDBNull = false; + this.columnY1.DefaultValue = ((double)(0)); + this.columnY2.AllowDBNull = false; + this.columnY2.DefaultValue = ((double)(0)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -943,6 +1013,10 @@ namespace Karinto.Xml { base.Columns.Add(this.columnX); this.columnY = new global::System.Data.DataColumn("Y", typeof(double), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnY); + this.columnX.AllowDBNull = false; + this.columnX.DefaultValue = ((double)(0)); + this.columnY.AllowDBNull = false; + this.columnY.DefaultValue = ((double)(0)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -1061,275 +1135,845 @@ namespace Karinto.Xml { } /// - ///Represents strongly named DataRow class. + ///Represents the strongly named DataTable class. /// [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] - public partial class PointListRow : global::System.Data.DataRow { + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class TimeFunction1ChDataTable : global::System.Data.DataTable, global::System.Collections.IEnumerable { - private PointListDataTable tablePointList; + private global::System.Data.DataColumn columnTime; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - internal PointListRow(global::System.Data.DataRowBuilder rb) : - base(rb) { - this.tablePointList = ((PointListDataTable)(this.Table)); - } + private global::System.Data.DataColumn columnY; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public double X { - get { - return ((double)(this[this.tablePointList.XColumn])); - } - set { - this[this.tablePointList.XColumn] = value; - } + public TimeFunction1ChDataTable() { + this.TableName = "TimeFunction1Ch"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public double Y { - get { - return ((double)(this[this.tablePointList.YColumn])); + internal TimeFunction1ChDataTable(global::System.Data.DataTable table) { + this.TableName = table.TableName; + if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { + this.CaseSensitive = table.CaseSensitive; } - set { - this[this.tablePointList.YColumn] = value; + 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; } - } - - /// - ///Represents strongly named DataRow class. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] - public partial class XY2ChRow : global::System.Data.DataRow { - - private XY2ChDataTable tableXY2Ch; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - internal XY2ChRow(global::System.Data.DataRowBuilder rb) : - base(rb) { - this.tableXY2Ch = ((XY2ChDataTable)(this.Table)); + protected TimeFunction1ChDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context) { + this.InitVars(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public double X { + public global::System.Data.DataColumn TimeColumn { get { - try { - return ((double)(this[this.tableXY2Ch.XColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("テーブル \'XY2Ch\' にある列 \'X\' の値は DBNull です。", e); - } - } - set { - this[this.tableXY2Ch.XColumn] = value; + return this.columnTime; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public double Y1 { + public global::System.Data.DataColumn YColumn { get { - try { - return ((double)(this[this.tableXY2Ch.Y1Column])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("テーブル \'XY2Ch\' にある列 \'Y1\' の値は DBNull です。", e); - } - } - set { - this[this.tableXY2Ch.Y1Column] = value; + return this.columnY; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public double Y2 { + [global::System.ComponentModel.Browsable(false)] + public int Count { get { - try { - return ((double)(this[this.tableXY2Ch.Y2Column])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("テーブル \'XY2Ch\' にある列 \'Y2\' の値は DBNull です。", e); - } - } - set { - this[this.tableXY2Ch.Y2Column] = value; + return this.Rows.Count; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public bool IsXNull() { - return this.IsNull(this.tableXY2Ch.XColumn); + public TimeFunction1ChRow this[int index] { + get { + return ((TimeFunction1ChRow)(this.Rows[index])); + } } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public void SetXNull() { - this[this.tableXY2Ch.XColumn] = global::System.Convert.DBNull; - } + public event TimeFunction1ChRowChangeEventHandler TimeFunction1ChRowChanging; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public bool IsY1Null() { - return this.IsNull(this.tableXY2Ch.Y1Column); - } + public event TimeFunction1ChRowChangeEventHandler TimeFunction1ChRowChanged; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public void SetY1Null() { - this[this.tableXY2Ch.Y1Column] = global::System.Convert.DBNull; - } + public event TimeFunction1ChRowChangeEventHandler TimeFunction1ChRowDeleting; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public bool IsY2Null() { - return this.IsNull(this.tableXY2Ch.Y2Column); - } + public event TimeFunction1ChRowChangeEventHandler TimeFunction1ChRowDeleted; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public void SetY2Null() { - this[this.tableXY2Ch.Y2Column] = global::System.Convert.DBNull; + public void AddTimeFunction1ChRow(TimeFunction1ChRow row) { + this.Rows.Add(row); } - } - - /// - ///Represents strongly named DataRow class. - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] - public partial class XY1ChRow : global::System.Data.DataRow { - - private XY1ChDataTable tableXY1Ch; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - internal XY1ChRow(global::System.Data.DataRowBuilder rb) : - base(rb) { - this.tableXY1Ch = ((XY1ChDataTable)(this.Table)); + public TimeFunction1ChRow AddTimeFunction1ChRow(System.DateTime Time, double Y) { + TimeFunction1ChRow rowTimeFunction1ChRow = ((TimeFunction1ChRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + Time, + Y}; + rowTimeFunction1ChRow.ItemArray = columnValuesArray; + this.Rows.Add(rowTimeFunction1ChRow); + return rowTimeFunction1ChRow; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public double X { - get { - try { - return ((double)(this[this.tableXY1Ch.XColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("テーブル \'XY1Ch\' にある列 \'X\' の値は DBNull です。", e); - } - } - set { - this[this.tableXY1Ch.XColumn] = value; - } + public virtual global::System.Collections.IEnumerator GetEnumerator() { + return this.Rows.GetEnumerator(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public double Y { - get { - try { - return ((double)(this[this.tableXY1Ch.YColumn])); - } - catch (global::System.InvalidCastException e) { - throw new global::System.Data.StrongTypingException("テーブル \'XY1Ch\' にある列 \'Y\' の値は DBNull です。", e); - } - } - set { - this[this.tableXY1Ch.YColumn] = value; - } + public override global::System.Data.DataTable Clone() { + TimeFunction1ChDataTable cln = ((TimeFunction1ChDataTable)(base.Clone())); + cln.InitVars(); + return cln; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public bool IsXNull() { - return this.IsNull(this.tableXY1Ch.XColumn); + protected override global::System.Data.DataTable CreateInstance() { + return new TimeFunction1ChDataTable(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public void SetXNull() { - this[this.tableXY1Ch.XColumn] = global::System.Convert.DBNull; + internal void InitVars() { + this.columnTime = base.Columns["Time"]; + this.columnY = base.Columns["Y"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public bool IsYNull() { - return this.IsNull(this.tableXY1Ch.YColumn); + private void InitClass() { + this.columnTime = new global::System.Data.DataColumn("Time", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnTime); + this.columnY = new global::System.Data.DataColumn("Y", typeof(double), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnY); + this.columnTime.AllowDBNull = false; + this.columnY.AllowDBNull = false; + this.columnY.DefaultValue = ((double)(0)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public void SetYNull() { - this[this.tableXY1Ch.YColumn] = global::System.Convert.DBNull; + public TimeFunction1ChRow NewTimeFunction1ChRow() { + return ((TimeFunction1ChRow)(this.NewRow())); } - } - - /// - ///Row event argument class - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] - public class PointListRowChangeEvent : global::System.EventArgs { - - private PointListRow eventRow; - - private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public PointListRowChangeEvent(PointListRow row, global::System.Data.DataRowAction action) { - this.eventRow = row; - this.eventAction = action; + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new TimeFunction1ChRow(builder); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public PointListRow Row { - get { - return this.eventRow; - } + protected override global::System.Type GetRowType() { + return typeof(TimeFunction1ChRow); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public global::System.Data.DataRowAction Action { - get { - return this.eventAction; + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.TimeFunction1ChRowChanged != null)) { + this.TimeFunction1ChRowChanged(this, new TimeFunction1ChRowChangeEvent(((TimeFunction1ChRow)(e.Row)), e.Action)); } } - } - - /// - ///Row event argument class - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] - public class XY2ChRowChangeEvent : global::System.EventArgs { - - private XY2ChRow eventRow; - - private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public XY2ChRowChangeEvent(XY2ChRow row, global::System.Data.DataRowAction action) { - this.eventRow = row; - this.eventAction = action; + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.TimeFunction1ChRowChanging != null)) { + this.TimeFunction1ChRowChanging(this, new TimeFunction1ChRowChangeEvent(((TimeFunction1ChRow)(e.Row)), e.Action)); + } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public XY2ChRow Row { - get { - return this.eventRow; + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.TimeFunction1ChRowDeleted != null)) { + this.TimeFunction1ChRowDeleted(this, new TimeFunction1ChRowChangeEvent(((TimeFunction1ChRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public global::System.Data.DataRowAction Action { - get { - return this.eventAction; + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.TimeFunction1ChRowDeleting != null)) { + this.TimeFunction1ChRowDeleting(this, new TimeFunction1ChRowChangeEvent(((TimeFunction1ChRow)(e.Row)), e.Action)); } } - } - - /// - ///Row event argument class - /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] - public class XY1ChRowChangeEvent : global::System.EventArgs { - - private XY1ChRow eventRow; - - private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public XY1ChRowChangeEvent(XY1ChRow row, global::System.Data.DataRowAction action) { - this.eventRow = row; - this.eventAction = action; + public void RemoveTimeFunction1ChRow(TimeFunction1ChRow row) { + this.Rows.Remove(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - public XY1ChRow Row { + public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { + global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); + global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); + Data ds = new Data(); + global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); + any1.Namespace = "http://www.w3.org/2001/XMLSchema"; + any1.MinOccurs = new decimal(0); + any1.MaxOccurs = decimal.MaxValue; + any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any1); + global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); + any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; + any2.MinOccurs = new decimal(1); + any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any2); + global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute1.Name = "namespace"; + attribute1.FixedValue = ds.Namespace; + type.Attributes.Add(attribute1); + global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute2.Name = "tableTypeName"; + attribute2.FixedValue = "TimeFunction1ChDataTable"; + type.Attributes.Add(attribute2); + type.Particle = sequence; + global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); + if (xs.Contains(dsSchema.TargetNamespace)) { + global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); + global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); + try { + global::System.Xml.Schema.XmlSchema schema = null; + dsSchema.Write(s1); + for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { + schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); + s2.SetLength(0); + schema.Write(s2); + if ((s1.Length == s2.Length)) { + s1.Position = 0; + s2.Position = 0; + for (; ((s1.Position != s1.Length) + && (s1.ReadByte() == s2.ReadByte())); ) { + ; + } + if ((s1.Position == s1.Length)) { + return type; + } + } + } + } + finally { + if ((s1 != null)) { + s1.Close(); + } + if ((s2 != null)) { + s2.Close(); + } + } + } + xs.Add(dsSchema); + return type; + } + } + + /// + ///Represents the strongly named DataTable class. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] + [global::System.Serializable()] + [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] + public partial class TimeFunction2ChDataTable : global::System.Data.DataTable, global::System.Collections.IEnumerable { + + private global::System.Data.DataColumn columnTime; + + private global::System.Data.DataColumn columnY1; + + private global::System.Data.DataColumn columnY2; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public TimeFunction2ChDataTable() { + this.TableName = "TimeFunction2Ch"; + this.BeginInit(); + this.InitClass(); + this.EndInit(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + internal TimeFunction2ChDataTable(global::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; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + protected TimeFunction2ChDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : + base(info, context) { + this.InitVars(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Data.DataColumn TimeColumn { + get { + return this.columnTime; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Data.DataColumn Y1Column { + get { + return this.columnY1; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Data.DataColumn Y2Column { + get { + return this.columnY2; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.ComponentModel.Browsable(false)] + public int Count { + get { + return this.Rows.Count; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public TimeFunction2ChRow this[int index] { + get { + return ((TimeFunction2ChRow)(this.Rows[index])); + } + } + + public event TimeFunction2ChRowChangeEventHandler TimeFunction2ChRowChanging; + + public event TimeFunction2ChRowChangeEventHandler TimeFunction2ChRowChanged; + + public event TimeFunction2ChRowChangeEventHandler TimeFunction2ChRowDeleting; + + public event TimeFunction2ChRowChangeEventHandler TimeFunction2ChRowDeleted; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void AddTimeFunction2ChRow(TimeFunction2ChRow row) { + this.Rows.Add(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public TimeFunction2ChRow AddTimeFunction2ChRow(System.DateTime Time, double Y1, double Y2) { + TimeFunction2ChRow rowTimeFunction2ChRow = ((TimeFunction2ChRow)(this.NewRow())); + object[] columnValuesArray = new object[] { + Time, + Y1, + Y2}; + rowTimeFunction2ChRow.ItemArray = columnValuesArray; + this.Rows.Add(rowTimeFunction2ChRow); + return rowTimeFunction2ChRow; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public virtual global::System.Collections.IEnumerator GetEnumerator() { + return this.Rows.GetEnumerator(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public override global::System.Data.DataTable Clone() { + TimeFunction2ChDataTable cln = ((TimeFunction2ChDataTable)(base.Clone())); + cln.InitVars(); + return cln; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + protected override global::System.Data.DataTable CreateInstance() { + return new TimeFunction2ChDataTable(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + internal void InitVars() { + this.columnTime = base.Columns["Time"]; + this.columnY1 = base.Columns["Y1"]; + this.columnY2 = base.Columns["Y2"]; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + private void InitClass() { + this.columnTime = new global::System.Data.DataColumn("Time", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnTime); + this.columnY1 = new global::System.Data.DataColumn("Y1", typeof(double), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnY1); + this.columnY2 = new global::System.Data.DataColumn("Y2", typeof(double), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnY2); + this.columnTime.AllowDBNull = false; + this.columnY1.AllowDBNull = false; + this.columnY1.DefaultValue = ((double)(0)); + this.columnY2.AllowDBNull = false; + this.columnY2.DefaultValue = ((double)(0)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public TimeFunction2ChRow NewTimeFunction2ChRow() { + return ((TimeFunction2ChRow)(this.NewRow())); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { + return new TimeFunction2ChRow(builder); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + protected override global::System.Type GetRowType() { + return typeof(TimeFunction2ChRow); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanged(e); + if ((this.TimeFunction2ChRowChanged != null)) { + this.TimeFunction2ChRowChanged(this, new TimeFunction2ChRowChangeEvent(((TimeFunction2ChRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowChanging(e); + if ((this.TimeFunction2ChRowChanging != null)) { + this.TimeFunction2ChRowChanging(this, new TimeFunction2ChRowChangeEvent(((TimeFunction2ChRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleted(e); + if ((this.TimeFunction2ChRowDeleted != null)) { + this.TimeFunction2ChRowDeleted(this, new TimeFunction2ChRowChangeEvent(((TimeFunction2ChRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { + base.OnRowDeleting(e); + if ((this.TimeFunction2ChRowDeleting != null)) { + this.TimeFunction2ChRowDeleting(this, new TimeFunction2ChRowChangeEvent(((TimeFunction2ChRow)(e.Row)), e.Action)); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public void RemoveTimeFunction2ChRow(TimeFunction2ChRow row) { + this.Rows.Remove(row); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { + global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); + global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); + Data ds = new Data(); + global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); + any1.Namespace = "http://www.w3.org/2001/XMLSchema"; + any1.MinOccurs = new decimal(0); + any1.MaxOccurs = decimal.MaxValue; + any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any1); + global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); + any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; + any2.MinOccurs = new decimal(1); + any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; + sequence.Items.Add(any2); + global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute1.Name = "namespace"; + attribute1.FixedValue = ds.Namespace; + type.Attributes.Add(attribute1); + global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); + attribute2.Name = "tableTypeName"; + attribute2.FixedValue = "TimeFunction2ChDataTable"; + type.Attributes.Add(attribute2); + type.Particle = sequence; + global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); + if (xs.Contains(dsSchema.TargetNamespace)) { + global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); + global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); + try { + global::System.Xml.Schema.XmlSchema schema = null; + dsSchema.Write(s1); + for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { + schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); + s2.SetLength(0); + schema.Write(s2); + if ((s1.Length == s2.Length)) { + s1.Position = 0; + s2.Position = 0; + for (; ((s1.Position != s1.Length) + && (s1.ReadByte() == s2.ReadByte())); ) { + ; + } + if ((s1.Position == s1.Length)) { + return type; + } + } + } + } + finally { + if ((s1 != null)) { + s1.Close(); + } + if ((s2 != null)) { + s2.Close(); + } + } + } + xs.Add(dsSchema); + return type; + } + } + + /// + ///Represents strongly named DataRow class. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] + public partial class PointListRow : global::System.Data.DataRow { + + private PointListDataTable tablePointList; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + internal PointListRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tablePointList = ((PointListDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public double X { + get { + return ((double)(this[this.tablePointList.XColumn])); + } + set { + this[this.tablePointList.XColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public double Y { + get { + return ((double)(this[this.tablePointList.YColumn])); + } + set { + this[this.tablePointList.YColumn] = value; + } + } + } + + /// + ///Represents strongly named DataRow class. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] + public partial class XY2ChRow : global::System.Data.DataRow { + + private XY2ChDataTable tableXY2Ch; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + internal XY2ChRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableXY2Ch = ((XY2ChDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public double X { + get { + return ((double)(this[this.tableXY2Ch.XColumn])); + } + set { + this[this.tableXY2Ch.XColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public double Y1 { + get { + return ((double)(this[this.tableXY2Ch.Y1Column])); + } + set { + this[this.tableXY2Ch.Y1Column] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public double Y2 { + get { + return ((double)(this[this.tableXY2Ch.Y2Column])); + } + set { + this[this.tableXY2Ch.Y2Column] = value; + } + } + } + + /// + ///Represents strongly named DataRow class. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] + public partial class XY1ChRow : global::System.Data.DataRow { + + private XY1ChDataTable tableXY1Ch; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + internal XY1ChRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableXY1Ch = ((XY1ChDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public double X { + get { + return ((double)(this[this.tableXY1Ch.XColumn])); + } + set { + this[this.tableXY1Ch.XColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public double Y { + get { + return ((double)(this[this.tableXY1Ch.YColumn])); + } + set { + this[this.tableXY1Ch.YColumn] = value; + } + } + } + + /// + ///Represents strongly named DataRow class. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] + public partial class TimeFunction1ChRow : global::System.Data.DataRow { + + private TimeFunction1ChDataTable tableTimeFunction1Ch; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + internal TimeFunction1ChRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableTimeFunction1Ch = ((TimeFunction1ChDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public System.DateTime Time { + get { + return ((global::System.DateTime)(this[this.tableTimeFunction1Ch.TimeColumn])); + } + set { + this[this.tableTimeFunction1Ch.TimeColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public double Y { + get { + return ((double)(this[this.tableTimeFunction1Ch.YColumn])); + } + set { + this[this.tableTimeFunction1Ch.YColumn] = value; + } + } + } + + /// + ///Represents strongly named DataRow class. + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] + public partial class TimeFunction2ChRow : global::System.Data.DataRow { + + private TimeFunction2ChDataTable tableTimeFunction2Ch; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + internal TimeFunction2ChRow(global::System.Data.DataRowBuilder rb) : + base(rb) { + this.tableTimeFunction2Ch = ((TimeFunction2ChDataTable)(this.Table)); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public System.DateTime Time { + get { + return ((global::System.DateTime)(this[this.tableTimeFunction2Ch.TimeColumn])); + } + set { + this[this.tableTimeFunction2Ch.TimeColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public double Y1 { + get { + return ((double)(this[this.tableTimeFunction2Ch.Y1Column])); + } + set { + this[this.tableTimeFunction2Ch.Y1Column] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public double Y2 { + get { + return ((double)(this[this.tableTimeFunction2Ch.Y2Column])); + } + set { + this[this.tableTimeFunction2Ch.Y2Column] = value; + } + } + } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] + public class PointListRowChangeEvent : global::System.EventArgs { + + private PointListRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public PointListRowChangeEvent(PointListRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public PointListRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] + public class XY2ChRowChangeEvent : global::System.EventArgs { + + private XY2ChRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public XY2ChRowChangeEvent(XY2ChRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public XY2ChRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] + public class XY1ChRowChangeEvent : global::System.EventArgs { + + private XY1ChRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public XY1ChRowChangeEvent(XY1ChRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public XY1ChRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] + public class TimeFunction1ChRowChangeEvent : global::System.EventArgs { + + private TimeFunction1ChRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public TimeFunction1ChRowChangeEvent(TimeFunction1ChRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public TimeFunction1ChRow Row { + get { + return this.eventRow; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public global::System.Data.DataRowAction Action { + get { + return this.eventAction; + } + } + } + + /// + ///Row event argument class + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] + public class TimeFunction2ChRowChangeEvent : global::System.EventArgs { + + private TimeFunction2ChRow eventRow; + + private global::System.Data.DataRowAction eventAction; + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public TimeFunction2ChRowChangeEvent(TimeFunction2ChRow row, global::System.Data.DataRowAction action) { + this.eventRow = row; + this.eventAction = action; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public TimeFunction2ChRow Row { get { return this.eventRow; } diff --git a/Karinto/Xml/Data.xsd b/Karinto/Xml/Data.xsd index d841892..7a63559 100755 --- a/Karinto/Xml/Data.xsd +++ b/Karinto/Xml/Data.xsd @@ -15,25 +15,42 @@ - - + + - - - + + + - - + + + + + + + + + + + + + + + + + + + diff --git a/Karinto/Xml/Data.xss b/Karinto/Xml/Data.xss index 3791ac9..3fadd7d 100755 --- a/Karinto/Xml/Data.xss +++ b/Karinto/Xml/Data.xss @@ -4,11 +4,13 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - - - + + + + + \ No newline at end of file diff --git a/KarintoTest/CsvReaderTest.cs b/KarintoTest/CsvReaderTest.cs index 989e3b4..e6ca2c7 100755 --- a/KarintoTest/CsvReaderTest.cs +++ b/KarintoTest/CsvReaderTest.cs @@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; +using System.Data; using Karinto; using Karinto.Xml; using NUnit.Framework; @@ -26,10 +27,6 @@ namespace KarintoTest new CsvReader(); Data.XY2ChDataTable table = reader.Read("Resources/d_d_d.csv"); - Assert.AreEqual("Header1", table.XColumn.ColumnName); - Assert.AreEqual("Header2", table.Y1Column.ColumnName); - Assert.AreEqual("Header3", table.Y2Column.ColumnName); - Assert.AreEqual("Header1", table.XColumn.Caption); Assert.AreEqual("Header2", table.Y1Column.Caption); Assert.AreEqual("Header3", table.Y2Column.Caption); @@ -54,9 +51,6 @@ namespace KarintoTest new CsvReader(); Data.XY1ChDataTable table = reader.Read("Resources/d_d_d.csv"); - Assert.AreEqual("Header1", table.XColumn.ColumnName); - Assert.AreEqual("Header2", table.YColumn.ColumnName); - Assert.AreEqual("Header1", table.XColumn.Caption); Assert.AreEqual("Header2", table.YColumn.Caption); @@ -68,5 +62,35 @@ namespace KarintoTest Assert.AreEqual(0.0, table[50].Y); Assert.AreEqual(0.0, table[100].Y); } + + [Test] + public void Prototype() + { + DataTable prototype = new DataTable(); + prototype.Columns.Add("X", typeof(decimal)); + prototype.Columns.Add("Y1", typeof(float)); + prototype.Columns.Add("Y2", typeof(int)); + + CsvReader reader = new CsvReader(prototype); + prototype = null; + + DataTable table = reader.Read("Resources/d_d_d.csv"); + + Assert.AreEqual("Header1", table.Columns["X"].Caption); + Assert.AreEqual("Header2", table.Columns["Y1"].Caption); + Assert.AreEqual("Header3", table.Columns["Y2"].Caption); + + Assert.AreEqual(0.0m, table.Rows[0]["X"]); + Assert.AreEqual(5.0m, table.Rows[50]["X"]); + Assert.AreEqual(10.0m, table.Rows[100]["X"]); + + Assert.AreEqual(0.0f, table.Rows[0]["Y1"]); + Assert.AreEqual(0.0f, table.Rows[50]["Y1"]); + Assert.AreEqual(0.0f, table.Rows[100]["Y1"]); + + Assert.AreEqual(0, table.Rows[0]["Y2"]); + Assert.AreEqual(1, table.Rows[50]["Y2"]); + Assert.AreEqual(0, table.Rows[100]["Y2"]); + } } } -- 2.11.0