/// <summary>
        /// Accepts an object update message pre-commit so that it can add the change to the underlying context
        /// </summary>
        /// <param name="message">The object update message</param>
        public void AcceptMessage(IUpdating <KeyedObject> message)
        {
            Contract.Requires(message != null);

            if (message.Target.GetType().GetCustomAttribute <DontAuditChangesAttribute>() != null)
            {
                return;
            }

            foreach (KeyValuePair <string, object> newValue in message.NewValues)
            {
                AuditEntry thisEntry = new AuditEntry()
                {
                    ContextId     = ContextId,
                    NewValue      = newValue.Value?.ToString(),
                    PropertyName  = newValue.Key,
                    Target        = (message.Target as Entity)?.Guid ?? Guid.Empty,
                    Target_Id     = message.Target._Id,
                    TypeName      = message.Target.GetType().Name,
                    TypeNamespace = message.Target.GetType().Namespace,
                    Source        = UserSession?.LoggedInUser?.Guid ?? Guid.Empty
                };

                this.Context.Add(thisEntry);
            }
        }
Exemple #2
0
 public void Setup()
 {
     _testTrack1 = new Track()
     {
         Altitude  = 10000,
         X         = 50000,
         Y         = 50000,
         Course    = 200,
         Tag       = "test1",
         TimeStamp = DateTime.Now,
         Velocity  = 300
     };
     _testTrack2 = new Track()
     {
         Altitude  = 11000,
         X         = 51000,
         Y         = 51000,
         Course    = 210,
         Tag       = "test2",
         TimeStamp = DateTime.Now,
         Velocity  = 310
     };
     _trackUpdate = Substitute.For <IUpdating>();
     _output      = Substitute.For <IOutput>();
     _uut         = new Rendering(_trackUpdate, _output);
 }
 public DojoUpdatingTimer(IUpdating updating, double interval)
 {
     this.updating = updating;
     timer.Interval = interval;
     timer.Enabled = false;
     timer.AutoReset = true;
     timer.Elapsed += Update;
 }
 public DojoUpdatingTimer(IUpdating updating, double interval)
 {
     this.updating   = updating;
     timer.Interval  = interval;
     timer.Enabled   = false;
     timer.AutoReset = true;
     timer.Elapsed  += Update;
 }
Exemple #5
0
 public static void Register(IUpdating t, bool autoDispose = false)
 {
     Load();
     instance.clients.Add(t);
     if (autoDispose)
     {
         SceneLoadDisposal.Add(t);
     }
 }
Exemple #6
0
 public override void Dispose()
 {
     base.Dispose();
     if (this._updater != null)
     {
         this._updater.Release();
     }
     this._easing  = null;
     this._updater = null;
 }
        public void AcceptMessage(IUpdating <Entity> update)
        {
            if (update is null)
            {
                throw new ArgumentNullException(nameof(update));
            }

            if (this.EntityPermissionsRepository.GetForEntity(update.Target) is null)
            {
                this.SetDefaultPermissions(update.Target);
            }
        }
Exemple #8
0
 public static void Unregister(IUpdating t)
 {
     Load();
     instance.clients.Remove(t);
 }
 public UpdatingContainer(IUpdating updatingObject, GetFunction function)
 {
     this.updatingObject = updatingObject;
     Function            = function;
 }
Exemple #10
0
 public Rendering(IUpdating trackUpdate, IOutput output)
 {
     _output = output;
     trackUpdate.TracksUpdated += RenderTracks;
 }
Exemple #11
0
 public void Add(IUpdating u) => bindings.Add(u);
Exemple #12
0
 public static void Add(IUpdating alpha)
 {
     updating.Add(alpha);
 }
Exemple #13
0
 public static void Add(IUpdating alpha)
 {
     updating.Add(alpha);
 }