WriteEventArgs.cs :  » Persistence-Frameworks » FileHelpers-Library » FileHelpers » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Persistence Frameworks » FileHelpers Library 
FileHelpers Library » FileHelpers » WriteEventArgs.cs
using System;
using System.ComponentModel;

namespace FileHelpers{

    
   
#if NET_1_1
    /// <summary>Base class of <see cref="BeforeWriteRecordEventArgs" /> and <see cref="AfterWriteRecordEventArgs" /></summary>
    [EditorBrowsable(EditorBrowsableState.Never)]
    public abstract class WriteRecordEventArgs: EventArgs
  {
    internal WriteRecordEventArgs(object record, int lineNumber)
    {
      mRecord = record;
      mLineNumber = lineNumber;
    }
#else
    /// <summary>Base class of <see cref="BeforeWriteRecordEventArgs&lt;T&gt;"/> and <see cref="AfterWriteRecordEventArgs&lt;T&gt;"/></summary>
    [EditorBrowsable(EditorBrowsableState.Never)]
    public abstract class WriteRecordEventArgs<T> : EventArgs
  {
    internal WriteRecordEventArgs(T record, int lineNumber)
    {
      mRecord = record;
      mLineNumber = lineNumber;
    }
#endif


#if NET_1_1
    private object mRecord;

    /// <summary>The current record.</summary>
    public object Record
    {
      get { return mRecord; }
    }
#else
    private T mRecord;

    /// <summary>The current record.</summary>
    public T Record
    {
      get { return mRecord; }
    }
#endif
      


    private int mLineNumber;

    /// <summary>The current line number.</summary>
    public int LineNumber
    {
      get { return mLineNumber; }
    }

  }

  /// <summary>Arguments for the <see cref="BeforeWriteRecordHandler"/></summary>

#if NET_1_1
  public sealed class BeforeWriteRecordEventArgs: WriteRecordEventArgs
  {
    internal BeforeWriteRecordEventArgs(object record, int lineNumber)
#else
    public sealed class BeforeWriteRecordEventArgs: BeforeWriteRecordEventArgs<object>
    {
        internal BeforeWriteRecordEventArgs(object record, int lineNumber)
      : base(record, lineNumber)
    {}

    }
  /// <summary>Arguments for the <see cref="BeforeWriteRecordHandler"/></summary>
    public class BeforeWriteRecordEventArgs<T>: WriteRecordEventArgs<T>
  {
    internal BeforeWriteRecordEventArgs(T record, int lineNumber)
#endif
      : base(record, lineNumber)
    {}

    private bool mSkipThisRecord = false;
    /// <summary>Set this property as true if you want to bypass the current record.</summary>
    public bool SkipThisRecord
    {
      get { return mSkipThisRecord; }
      set { mSkipThisRecord = value; }
    }

  }

  /// <summary>Arguments for the <see cref="AfterWriteRecordHandler"/></summary>
#if NET_1_1
  public sealed class AfterWriteRecordEventArgs: WriteRecordEventArgs
  {
    internal AfterWriteRecordEventArgs(object record, int lineNumber, string line): base(record, lineNumber)
#else
     public sealed class AfterWriteRecordEventArgs: AfterWriteRecordEventArgs<object>
    {
        internal AfterWriteRecordEventArgs(object record, int lineNumber, string line)
            :base(record, lineNumber, line)
        { }
    }
  /// <summary>Arguments for the <see cref="AfterWriteRecordHandler"/></summary>
  public class AfterWriteRecordEventArgs<T>: WriteRecordEventArgs<T>
  {
    internal AfterWriteRecordEventArgs(T record, int lineNumber, string line): base(record, lineNumber)
#endif
    {
      mRecordLine = line;
    }

    private string mRecordLine;
    /// <summary>The line to be written to the file. WARNING: you can change this and the engines will write it to the file.</summary>
    public string RecordLine
    {
      get { return mRecordLine; }
      set { mRecordLine = value; }
    }

  }

}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.