zetaenterpriselibrary-source.zip
Caching
Common
Core
Data
Logging
References
Direct
ICSharpCode.SharpZipLib.dll
log4net.dll
NUnit
nunit.framework.dll
nunit.framework.extensions.dll
nunit.mocks.dll
Externals
ZetaLongPaths
ZetaLongPaths.dll
ZetaWebControlLibrary
de
ZetaWebControlLib.resources.dll
ZetaWebControlLib.dll
Tools
UnitTests
Properties
Resources
access.mdb
Tests
Common
Data
Logging
Tools
UnitTests.csproj
Web
Windows
Base
Common
Configuration
Controls
Dialogs
Misc
Properties
Windows.csproj
Windows.snk
ZetaEnterpriseLibrary.sln
zetaenterpriselibrary-bin.zip
de
Zeta.EnterpriseLibrary.Common.resources.dll
Zeta.EnterpriseLibrary.Data.resources.dll
Zeta.EnterpriseLibrary.Logging.resources.dll
Zeta.EnterpriseLibrary.Tools.resources.dll
Zeta.EnterpriseLibrary.Web.resources.dll
Zeta.EnterpriseLibrary.Windows.resources.dll
ICSharpCode.SharpZipLib.dll
log4net.dll
Zeta.EnterpriseLibrary.Common.dll
Zeta.EnterpriseLibrary.Common.pdb
Zeta.EnterpriseLibrary.Data.dll
Zeta.EnterpriseLibrary.Data.pdb
Zeta.EnterpriseLibrary.Logging.dll
Zeta.EnterpriseLibrary.Logging.pdb
Zeta.EnterpriseLibrary.Tools.dll
Zeta.EnterpriseLibrary.Tools.pdb
Zeta.EnterpriseLibrary.Web.dll
Zeta.EnterpriseLibrary.Web.pdb
Zeta.EnterpriseLibrary.Windows.dll
Zeta.EnterpriseLibrary.Windows.pdb
ZetaLongPaths.dll
ZetaLongPaths.pdb
|
namespace Zeta.EnterpriseLibrary.Data.Common
{
#region Using directives.
// ----------------------------------------------------------------------
using System.ComponentModel;
using System.Data;
// ----------------------------------------------------------------------
#endregion
/////////////////////////////////////////////////////////////////////////
/// <summary>
/// Class to pass additional information to an updater class.
/// </summary>
public class AdoNetUpdaterInformation
{
#region Public methods.
// ------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the
/// <see cref="AdoNetUpdaterInformation"/> class.
/// </summary>
public AdoNetUpdaterInformation()
{
}
/// <summary>
/// Initializes a new instance of the
/// <see cref="AdoNetUpdaterInformation"/> class.
/// </summary>
/// <param name="continueUpdateOnError">if set to <c>true</c>
/// [continue update on error].</param>
public AdoNetUpdaterInformation(
bool continueUpdateOnError )
{
_continueUpdateOnError = continueUpdateOnError;
}
/// <summary>
/// Initializes a new instance of the
/// <see cref="AdoNetUpdaterInformation"/> class.
/// </summary>
/// <param name="continueUpdateOnError">if set to <c>true</c>
/// [continue update on error].</param>
/// <param name="conflictOption">The conflict option.</param>
public AdoNetUpdaterInformation(
bool continueUpdateOnError,
ConflictOption conflictOption )
{
_continueUpdateOnError = continueUpdateOnError;
_conflictOption = conflictOption;
}
/// <summary>
/// Notifies the error occured.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="args">The <see cref="UpdateErrorOccurredEventArgs"/>
/// instance containing the event data.</param>
internal void NotifyErrorOccured(
object sender,
UpdateErrorOccurredEventArgs args )
{
if ( UpdateErrorOccured != null )
{
UpdateErrorOccured( sender, args );
}
}
/// <summary>
/// Notifies the row updated zero records affected.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="args">The <see cref="RowUpdatedErrorOccurredEventArgs"/>
/// instance containing the event data.</param>
internal void NotifyRowUpdatedErrorOccured(
object sender,
RowUpdatedErrorOccurredEventArgs args )
{
if ( RowUpdatedErrorOccured != null )
{
RowUpdatedErrorOccured( sender, args );
}
}
/// <summary>
/// Notifies the row updating error occurs.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="args">The <see cref="RowUpdatingErrorOccursEventArgs"/>
/// instance containing the event data.</param>
public void NotifyRowUpdatingErrorOccurs(
object sender,
RowUpdatingErrorOccursEventArgs args )
{
if ( RowUpdatingErrorOccurs != null )
{
RowUpdatingErrorOccurs( sender, args );
}
}
// ------------------------------------------------------------------
#endregion
#region Public events.
// ------------------------------------------------------------------
/// <summary>
/// Event to be called after an update error occured, to give
/// callers a chance to handle.
/// </summary>
public event UpdateErrorOccurredEvent UpdateErrorOccured;
/// <summary>
/// Event to be called after an update affected zero records, to give
/// callers a chance to handle.
/// </summary>
public event RowUpdatedErrorOccurredEvent RowUpdatedErrorOccured;
/// <summary>
/// Occurs when [row updating error occurs].
/// </summary>
public event RowUpdatingErrorOccursEvent RowUpdatingErrorOccurs;
// ------------------------------------------------------------------
#endregion
#region Public properties.
// ------------------------------------------------------------------
/// <summary>
/// Gets a value indicating whether [continue update on error].
/// </summary>
/// <value>
/// <c>true</c> if [continue update on error]; otherwise, <c>false</c>.
/// </value>
[DefaultValue( false )]
public bool ContinueUpdateOnError
{
get
{
return _continueUpdateOnError;
}
}
/// <summary>
/// Gets the conflict option.
/// </summary>
/// <value>The conflict option.</value>
/// <remarks>
/// Since I got lots of DBConcurrencyException inside the ZP8 project,
/// I decided to make the default conflict option to "OverwriteChanges",
/// meaning that only the primary key is compared and that the last one
/// (in a multithreaded environment) wins. For mose of MY scenarios,
/// this is sufficient.
/// See http://entwickler-forum.de/showthread.php?t=39541
/// </remarks>
[DefaultValue( ConflictOption.OverwriteChanges )]
public ConflictOption ConflictOption
{
get
{
return _conflictOption;
}
}
// ------------------------------------------------------------------
#endregion
#region Private variables.
// ------------------------------------------------------------------
private readonly bool _continueUpdateOnError;
private readonly ConflictOption _conflictOption =
ConflictOption.OverwriteChanges;
// ------------------------------------------------------------------
#endregion
}
/////////////////////////////////////////////////////////////////////////
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.