public override void SetUp() { base.SetUp(); myFormat = new PathSeriesFormat( "test" ); myFormat.Path = @"/BODY[0]/DIV[5]/DIV[0]/DIV[5]/DIV[0]/TABLE[0]/TBODY[0]"; myFormat.Anchor = Anchor.ForCell( new StringContainsLocator( 1, @"xetra" ), new AbsolutePositionLocator( 2 ) ); myFormat.TimeAxisPosition = 0; myFormat.SeriesNamePosition = 0; myPricesFile = Path.Combine( TestDataRoot, "Recognition", "ariva-prices.csv" ); }
//public PathSeriesFormat( PathSeriesFormat format, params TransformAction[] rules ) // : base( format, rules ) //{ // Path = rules.ApplyTo<string>( () => format.Path ); // Anchor = rules.ApplyTo<Anchor>( () => format.Anchor ); //} /// <summary> /// Creates a deep copy of the given object. /// </summary> public override IFormat Clone() { PathSeriesFormat other = new PathSeriesFormat( Name ); CloneTo( other ); other.Path = Path; other.Anchor = null; if ( Anchor != null ) { other.Anchor = Anchor.ForCell( Anchor.Row, Anchor.Column ); } return other; }
private DataTable Parse( PathSeriesFormat format, string file ) { var rawTable = CsvReader.Read( file, ";" ); return format.ToFormattedTable( rawTable ); }