Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ported library from VB.NET to C#. Closes #61.
All source code has been migrated to C# from VB.NET to allow for better cross platform usability. Functionality remains identical. Note: there may be some minor changes due to the way VB.NET handles strings.
- Loading branch information
Showing
286 changed files
with
18,094 additions
and
19,352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
// ___________________________________________________ | ||
// | ||
// © Hi-Integrity Systems 2010. All rights reserved. | ||
// www.hisystems.com.au - Toby Wicks | ||
// ___________________________________________________ | ||
// | ||
|
||
using System.Collections; | ||
using System; | ||
using System.Data; | ||
|
||
/// -------------------------------------------------------------------------------- | ||
/// <summary> | ||
/// Specifies the field name that uniquely identifies each object | ||
/// within the collection. Typically, this is the field name of an identity or auto | ||
/// increment field. If the SubSetAttribute has been specified | ||
/// then the strDistinctFieldName need only be unique within the subset not the | ||
/// entire table. The strDistinctFieldName and can be identical to the field name | ||
/// specified with a KeyField attribute. | ||
/// This attribute must be specified on a DatabaseObjects*UsingAttributes class. | ||
/// This attribute is used to implement the IDatabaseObjects.DistinctFieldName | ||
/// and IDatabaseObjects.DistinctFieldAutoIncrements functions. | ||
/// </summary> | ||
/// <example> | ||
/// <code> | ||
/// <DistinctField("CustomerID", bAutoIncrements:=True)> | ||
/// Public Class Customers | ||
/// ... | ||
/// </code> | ||
/// </example> | ||
/// -------------------------------------------------------------------------------- | ||
namespace DatabaseObjects | ||
{ | ||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] | ||
public class DistinctFieldAttribute : Attribute | ||
{ | ||
private string pstrDistinctFieldName; | ||
private SQL.FieldValueAutoAssignmentType peFieldValueAutomaticAssignment = SQL.FieldValueAutoAssignmentType.None; | ||
|
||
/// <summary> | ||
/// Specifies the field name that uniquely identifies each object | ||
/// within the collection. | ||
/// </summary> | ||
public DistinctFieldAttribute(string strDistinctFieldName) | ||
: this(strDistinctFieldName, bAutoIncrements: false) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Specifies the field name that uniquely identifies each object | ||
/// within the collection. Typically, this is the field name of an identity or auto | ||
/// increment field in which case the bAutoIncrements value should be set to true. | ||
/// </summary> | ||
public DistinctFieldAttribute(string strDistinctFieldName, bool bAutoIncrements) | ||
{ | ||
if (String.IsNullOrEmpty(strDistinctFieldName)) | ||
throw new ArgumentNullException(); | ||
|
||
pstrDistinctFieldName = strDistinctFieldName; | ||
|
||
if (bAutoIncrements) | ||
peFieldValueAutomaticAssignment = SQL.FieldValueAutoAssignmentType.AutoIncrement; | ||
} | ||
|
||
/// <summary> | ||
/// Specifies the field name that uniquely identifies each object | ||
/// within the collection. Typically, this is the field name of an identity or auto | ||
/// increment field in which case the bAutoIncrements value should be set to true. | ||
/// </summary> | ||
public DistinctFieldAttribute(string strDistinctFieldName, SQL.FieldValueAutoAssignmentType eAutomaticAssignment) | ||
{ | ||
if (String.IsNullOrEmpty(strDistinctFieldName)) | ||
throw new ArgumentNullException(); | ||
|
||
pstrDistinctFieldName = strDistinctFieldName; | ||
peFieldValueAutomaticAssignment = eAutomaticAssignment; | ||
} | ||
|
||
public string Name | ||
{ | ||
get | ||
{ | ||
return pstrDistinctFieldName; | ||
} | ||
} | ||
|
||
public SQL.FieldValueAutoAssignmentType AutomaticAssignment | ||
{ | ||
get | ||
{ | ||
return peFieldValueAutomaticAssignment; | ||
} | ||
} | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// ___________________________________________________ | ||
// | ||
// © Hi-Integrity Systems 2010. All rights reserved. | ||
// www.hisystems.com.au - Toby Wicks | ||
// ___________________________________________________ | ||
// | ||
|
||
using System.Collections; | ||
using System; | ||
using System.Data; | ||
|
||
/// -------------------------------------------------------------------------------- | ||
/// <summary> | ||
/// The FieldMappingAttribute class is used to define a mapping between a database | ||
/// field and a class property. This attribute is used with the | ||
/// DatabaseObjectUsingAttributes class. | ||
/// This field can also be used for loading fields that are of type | ||
/// DatabaseObjects.ObjectReference or DatabaseObjects.Generic.ObjectReference. | ||
/// </summary> | ||
/// -------------------------------------------------------------------------------- | ||
namespace DatabaseObjects | ||
{ | ||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] | ||
public class FieldMappingAttribute : Attribute | ||
{ | ||
private string pstrFieldName; | ||
|
||
/// -------------------------------------------------------------------------------- | ||
/// <param name="strFieldName"> | ||
/// The name of the database field associated with this property or field. | ||
/// </param> | ||
/// <example> | ||
/// Loads a field: | ||
/// <code> | ||
/// | ||
/// <DatabaseObjects.FieldMapping("Name")> _ | ||
/// Private pstrName As String | ||
/// | ||
/// </code> | ||
/// Loads an object: | ||
/// <code> | ||
/// | ||
/// <DatabaseObjects.FieldMapping("ProductGroupID")> _ | ||
/// Private pobjGroup As New Generic.ObjectReference(Of ProductGroup, Integer)(Database.ProductGroups) | ||
/// | ||
/// </code> | ||
/// </example> | ||
/// -------------------------------------------------------------------------------- | ||
public FieldMappingAttribute(string strFieldName) | ||
{ | ||
if (String.IsNullOrEmpty(strFieldName)) | ||
throw new ArgumentNullException(); | ||
|
||
pstrFieldName = strFieldName; | ||
} | ||
|
||
public string FieldName | ||
{ | ||
get | ||
{ | ||
return pstrFieldName; | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// ___________________________________________________ | ||
// | ||
// © Hi-Integrity Systems 2010. All rights reserved. | ||
// www.hisystems.com.au - Toby Wicks | ||
// ___________________________________________________ | ||
// | ||
|
||
using System.Collections; | ||
using System; | ||
using System.Data; | ||
|
||
/// -------------------------------------------------------------------------------- | ||
/// <summary> | ||
/// Used to mark a property or field that reference an object for which database | ||
/// fields need to be loaded. The referenced object then contain fields or properties | ||
/// marked with FieldMappingAttribute. | ||
/// The field must be marked on a reference type field not a value based field. | ||
/// This attribute is useful in situations where another class (usually an inner class) | ||
/// holds a reference to an object that contains additional properties that are stored | ||
/// in the same record as the main container class. | ||
/// </summary> | ||
/// -------------------------------------------------------------------------------- | ||
namespace DatabaseObjects | ||
{ | ||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] | ||
public class FieldMappingObjectHookAttribute : Attribute | ||
{ | ||
public FieldMappingObjectHookAttribute() | ||
{ | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.