-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from NerosoftDev/develop
Develop
- Loading branch information
Showing
115 changed files
with
5,130 additions
and
214 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
Large diffs are not rendered by default.
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
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
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
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
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
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
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
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,18 @@ | ||
using System.ComponentModel; | ||
|
||
namespace Nerosoft.Euonia.Business; | ||
|
||
public interface IBusinessObject : IUseBusinessContext, INotifyPropertyChanged, INotifyPropertyChanging | ||
{ | ||
FieldDataManager FieldManager { get; } | ||
|
||
bool FieldExists(IPropertyInfo property); | ||
|
||
object ReadProperty(IPropertyInfo propertyInfo); | ||
|
||
TValue ReadProperty<TValue>(PropertyInfo<TValue> propertyInfo); | ||
|
||
void LoadProperty(IPropertyInfo propertyInfo, object newValue); | ||
|
||
void LoadProperty<TValue>(PropertyInfo<TValue> propertyInfo, TValue newValue); | ||
} |
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,5 @@ | ||
namespace Nerosoft.Euonia.Business; | ||
|
||
public interface ICommandObject : IBusinessObject | ||
{ | ||
} |
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,26 @@ | ||
namespace Nerosoft.Euonia.Business; | ||
|
||
public interface IEditableObject | ||
{ | ||
/// <summary> | ||
/// Gets the current object state. | ||
/// </summary> | ||
ObjectEditState State { get; } | ||
|
||
/// <summary> | ||
/// Gets a value indicate if the object can save. | ||
/// </summary> | ||
bool IsSavable { get; } | ||
|
||
bool IsInsert { get; } | ||
|
||
bool IsUpdate { get; } | ||
|
||
bool IsDelete { get; } | ||
|
||
void MarkAsInsert(); | ||
|
||
void MarkAsUpdate(); | ||
|
||
void MarkAsDelete(); | ||
} |
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,37 @@ | ||
namespace Nerosoft.Euonia.Business; | ||
|
||
public interface IHasRuleCheck | ||
{ | ||
/// <summary> | ||
/// Gets a value indicate that whether the object is currently valid or not. | ||
/// </summary> | ||
/// <returns><c>True</c> if the object is currently valid, otherwise <c>False</c>.</returns> | ||
bool IsValid { get; } | ||
|
||
/// <summary> | ||
/// Indicates that a rule has completed. | ||
/// </summary> | ||
/// <param name="property"></param> | ||
void RuleCheckComplete(IPropertyInfo property); | ||
|
||
/// <summary> | ||
/// Indicates that a rule has completed. | ||
/// </summary> | ||
/// <param name="property"></param> | ||
void RuleCheckComplete(string property); | ||
|
||
/// <summary> | ||
/// Indicates that all rules have completed. | ||
/// </summary> | ||
void AllRulesComplete(); | ||
|
||
void SuspendRuleChecking(); | ||
|
||
void ResumeRuleChecking(); | ||
|
||
/// <summary> | ||
/// Gets the broken rules for this object | ||
/// </summary> | ||
/// <returns></returns> | ||
BrokenRuleCollection GetBrokenRules(); | ||
} |
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,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Nerosoft.Euonia.Business; | ||
|
||
public interface IOperableProperty | ||
{ | ||
object GetProperty(IPropertyInfo propertyInfo); | ||
|
||
void SetProperty(IPropertyInfo propertyInfo, object newValue); | ||
} |
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,6 @@ | ||
namespace Nerosoft.Euonia.Business; | ||
|
||
public interface IReadOnlyObject : IBusinessObject | ||
{ | ||
|
||
} |
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,45 @@ | ||
namespace Nerosoft.Euonia.Business; | ||
|
||
public interface ISavable | ||
{ | ||
/// <summary> | ||
/// Event raised when an object has been saved. | ||
/// </summary> | ||
event EventHandler<SavedEventArgs> Saved; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="newObject"></param> | ||
void SaveComplete(object newObject); | ||
|
||
/// <summary> | ||
/// Saves the object to the database. | ||
/// </summary> | ||
/// <param name="forceUpdate">true to force the save to be an update.</param> | ||
/// <param name="cancellationToken"></param> | ||
/// <returns>A new object containing the saved values.</returns> | ||
Task<object> SaveAsync(bool forceUpdate = false, CancellationToken cancellationToken = default); | ||
} | ||
|
||
public interface ISavable<T> where T : class | ||
{ | ||
/// <summary> | ||
/// Saves the object to the database. | ||
/// </summary> | ||
/// <param name="forceUpdate">true to force the save to be an update.</param> | ||
/// <param name="cancellationToken"></param> | ||
/// <returns>A new object containing the saved values.</returns> | ||
Task<T> SaveAsync(bool forceUpdate = false, CancellationToken cancellationToken = default); | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="newObject"></param> | ||
void SaveComplete(T newObject); | ||
|
||
/// <summary> | ||
/// Event raised when an object has been saved. | ||
/// </summary> | ||
event EventHandler<SavedEventArgs> Saved; | ||
} |
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,14 @@ | ||
namespace Nerosoft.Euonia.Business; | ||
|
||
public interface ITrackableObject | ||
{ | ||
bool IsValid { get; } | ||
|
||
bool IsChanged { get; } | ||
|
||
bool IsDeleted { get; } | ||
|
||
bool IsNew { get; } | ||
|
||
bool IsSavable { get; } | ||
} |
Oops, something went wrong.