|
@@ -6,37 +6,12 @@ using InABox.Clients;
|
|
|
|
|
|
namespace InABox.Core
|
|
|
{
|
|
|
- public enum MobileLogType
|
|
|
- {
|
|
|
- START,
|
|
|
- END
|
|
|
- }
|
|
|
- public class MobileLog
|
|
|
- {
|
|
|
- public string Message { get; set; }
|
|
|
-
|
|
|
- public MobileLog(string message, MobileLogType type)
|
|
|
- {
|
|
|
- Message = type + " " + message + "(" + DateTime.Now.ToString("m.s.fffff") + ")";
|
|
|
- }
|
|
|
-
|
|
|
- public static string ProduceLog(List<MobileLog> logs)
|
|
|
- {
|
|
|
- string finallog = "";
|
|
|
- foreach (var log in logs)
|
|
|
- {
|
|
|
- finallog = finallog + System.Environment.NewLine + log.Message;
|
|
|
- }
|
|
|
- return finallog;
|
|
|
- }
|
|
|
- }
|
|
|
public class DigitalFormDataModel<TEntity, TEntityLink, TInstance> : IDigitalFormDataModel
|
|
|
where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
where TEntityLink : EntityLink<TEntity>
|
|
|
where TInstance : Entity, IRemotable, IPersistent, IDigitalFormInstance<TEntityLink>, new()
|
|
|
{
|
|
|
private readonly bool bRequiresLoad = true;
|
|
|
- List<MobileLog> logs = new List<MobileLog>();
|
|
|
public DigitalFormDataModel(Guid entityid, Guid instanceid)
|
|
|
{
|
|
|
Entity = new TEntity();
|
|
@@ -88,7 +63,6 @@ namespace InABox.Core
|
|
|
|
|
|
public void Load(Action<IDigitalFormDataModel>? callback = null)
|
|
|
{
|
|
|
- logs.Add(new MobileLog("Load", MobileLogType.START));
|
|
|
if (!bRequiresLoad)
|
|
|
{
|
|
|
callback?.Invoke(this);
|
|
@@ -99,8 +73,6 @@ namespace InABox.Core
|
|
|
|
|
|
DoAddQueries(client);
|
|
|
|
|
|
- logs.Add(new MobileLog("Query", MobileLogType.START));
|
|
|
-
|
|
|
if (callback == null)
|
|
|
{
|
|
|
if (client.Count > 0)
|
|
@@ -120,9 +92,6 @@ namespace InABox.Core
|
|
|
else
|
|
|
callback.Invoke(this);
|
|
|
}
|
|
|
- logs.Add(new MobileLog("Query", MobileLogType.END));
|
|
|
- logs.Add(new MobileLog("Load", MobileLogType.END));
|
|
|
- var log = MobileLog.ProduceLog(logs);
|
|
|
}
|
|
|
|
|
|
public void Update(Action<IDigitalFormDataModel>? callback = null)
|