Ejemplo n.º 1
0
        private static void BeforeReadRecord(EngineBase engine, BeforeReadRecordEventArgs e)
        {
            Console.WriteLine("--> Before read line: " + e.RecordLine);

            if (e.LineNumber == 2)
            {
                e.SkipThisRecord = true;
                Console.WriteLine("-->   skiping line 2");
            }
        }
        //-> {/Example.File}
        //-> {Example.File:EventHandler.cs}
        private void BeforeEvent(EngineBase engine, BeforeReadEventArgs<OrdersFixed> e)
        {
            if (e.RecordLine.StartsWith(" ") || e.RecordLine.StartsWith("-"))
                e.SkipThisRecord = true;

            //  Sometimes changing the record line can be useful, for example to correct for
            //  a bad data layout.  Here is an example of this, commented out for this example

            //if (e.RecordLine.StartsWith(" "))
            //   e.RecordLine = "Be careful!";
        }
Ejemplo n.º 3
0
 private void BeforeEvent2(EngineBase sender, BeforeReadEventArgs<object> e)
 {
     e.SkipThisRecord = true;
     before++;
 }
Ejemplo n.º 4
0
        private void BeforeEvent(EngineBase sender, BeforeReadEventArgs<object> e)
        {
            if (e.RecordLine.StartsWith(" ") || e.RecordLine.StartsWith("-"))
                e.SkipThisRecord = true;

            before++;
        }
Ejemplo n.º 5
0
 private void AfterEvent2(EngineBase sender, AfterReadEventArgs<object> e)
 {
     e.SkipThisRecord = true;
     after++;
 }
Ejemplo n.º 6
0
		private static void AfterWriteRecord(EngineBase engine, AfterWriteRecordEventArgs e)
		{
			Console.WriteLine("--> After write record: " + e.RecordLine); 
		}
Ejemplo n.º 7
0
 private void AfterWriteEvent(EngineBase engine, AfterWriteEventArgs<OrdersFixed> e)
 {
     //  Hide a line
     if (e.Record.CustomerID == "HANAR")
         e.RecordLine = "Insufficient Access";
 }
Ejemplo n.º 8
0
 static void engine_AfterReadRecord(EngineBase engine, FileHelpers.Events.AfterReadEventArgs<FixedSampleRecord> e)
 {
 }
 private void engine_AfterWriteRecord(EngineBase sender, AfterWriteEventArgs<SampleType> e)
 {
     after++;
 }
 private void AfterEvent(EngineBase sender, AfterReadEventArgs<SampleType> e)
 {
     after++;
 }
Ejemplo n.º 11
0
        private void BeforeEvent2(EngineBase sender, BeforeReadRecordEventArgs<SampleType> e)
		{
			e.SkipThisRecord = true;
			before++;
		}
Ejemplo n.º 12
0
        private void AfterEvent2(EngineBase sender, AfterReadRecordEventArgs<SampleType> e)
		{
			e.SkipThisRecord = true;
			after++;
		}
Ejemplo n.º 13
0
		private void AfterEvent(EngineBase sender, AfterReadRecordEventArgs e)
		{
			after++;
		}
Ejemplo n.º 14
0
			public void BeforeWrite(EngineBase engine)
			{
				BeforeWriteNotif = true;
			}
Ejemplo n.º 15
0
			public void AfterRead(EngineBase engine, string line)
			{
				AfterReadNotif = true;
			}
Ejemplo n.º 16
0
 private void engine_AfterWriteRecord(EngineBase sender, AfterWriteEventArgs<object> e)
 {
     after++;
 }
Ejemplo n.º 17
0
 private void engine_BeforeWriteRecord(EngineBase sender, BeforeWriteEventArgs<object> e)
 {
     before++;
 }
 private void engine_BeforeWriteRecord(EngineBase sender, BeforeWriteEventArgs<SampleType> e)
 {
     before++;
 }
Ejemplo n.º 19
0
 static void engine_BeforeWriteRecord(EngineBase engine, FileHelpers.Events.BeforeWriteEventArgs<FixedSampleRecord> e)
 {
 }
Ejemplo n.º 20
0
 private void AfterWriteEvent(EngineBase engine, AfterWriteEventArgs<OrdersFixed> e)
 {
     //  We only want clients with large frieght values
     if (e.Record.CustomerID == "HANAR" )
         e.RecordLine = "Insufficient Access";
 }
Ejemplo n.º 21
0
 private void BeforeWriteEvent(EngineBase engine, BeforeWriteEventArgs<OrdersFixed> e)
 {
     //  We only want clients with large frieght values
     if (e.Record.Freight < 40)
         e.SkipThisRecord = true;
 }
Ejemplo n.º 22
0
 private static void BeforeEventChange(EngineBase engine, BeforeReadEventArgs<object> e)
 {
     Assert.IsFalse(e.RecordLineChanged);
     e.RecordLine = "11121314901234";
     Assert.IsTrue(e.RecordLineChanged);
 }
Ejemplo n.º 23
0
 private void AfterEvent(EngineBase engine, AfterReadEventArgs<OrdersFixed> e)
 {
     //  we want to drop all records with no freight
     if (e.Record.Freight == 0)
         e.SkipThisRecord = true;
 }
Ejemplo n.º 24
0
 private void AfterEvent(EngineBase sender, AfterReadEventArgs<object> e)
 {
     after++;
 }