Exemple #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!";
        }
Exemple #3
0
 private void BeforeEvent2(EngineBase sender, BeforeReadEventArgs<object> e)
 {
     e.SkipThisRecord = true;
     before++;
 }
Exemple #4
0
        private void BeforeEvent(EngineBase sender, BeforeReadEventArgs<object> e)
        {
            if (e.RecordLine.StartsWith(" ") || e.RecordLine.StartsWith("-"))
                e.SkipThisRecord = true;

            before++;
        }
Exemple #5
0
 private void AfterEvent2(EngineBase sender, AfterReadEventArgs<object> e)
 {
     e.SkipThisRecord = true;
     after++;
 }
Exemple #6
0
		private static void AfterWriteRecord(EngineBase engine, AfterWriteRecordEventArgs e)
		{
			Console.WriteLine("--> After write record: " + e.RecordLine); 
		}
Exemple #7
0
 private void AfterWriteEvent(EngineBase engine, AfterWriteEventArgs<OrdersFixed> e)
 {
     //  Hide a line
     if (e.Record.CustomerID == "HANAR")
         e.RecordLine = "Insufficient Access";
 }
 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++;
 }
        private void BeforeEvent2(EngineBase sender, BeforeReadRecordEventArgs<SampleType> e)
		{
			e.SkipThisRecord = true;
			before++;
		}
        private void AfterEvent2(EngineBase sender, AfterReadRecordEventArgs<SampleType> e)
		{
			e.SkipThisRecord = true;
			after++;
		}
Exemple #13
0
		private void AfterEvent(EngineBase sender, AfterReadRecordEventArgs e)
		{
			after++;
		}
			public void BeforeWrite(EngineBase engine)
			{
				BeforeWriteNotif = true;
			}
			public void AfterRead(EngineBase engine, string line)
			{
				AfterReadNotif = true;
			}
Exemple #16
0
 private void engine_AfterWriteRecord(EngineBase sender, AfterWriteEventArgs<object> e)
 {
     after++;
 }
Exemple #17
0
 private void engine_BeforeWriteRecord(EngineBase sender, BeforeWriteEventArgs<object> e)
 {
     before++;
 }
 private void engine_BeforeWriteRecord(EngineBase sender, BeforeWriteEventArgs<SampleType> e)
 {
     before++;
 }
 static void engine_BeforeWriteRecord(EngineBase engine, FileHelpers.Events.BeforeWriteEventArgs<FixedSampleRecord> e)
 {
 }
 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";
 }
Exemple #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;
 }
Exemple #22
0
 private static void BeforeEventChange(EngineBase engine, BeforeReadEventArgs<object> e)
 {
     Assert.IsFalse(e.RecordLineChanged);
     e.RecordLine = "11121314901234";
     Assert.IsTrue(e.RecordLineChanged);
 }
Exemple #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;
 }
Exemple #24
0
 private void AfterEvent(EngineBase sender, AfterReadEventArgs<object> e)
 {
     after++;
 }