/// <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);
            }
        }
Beispiel #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;
 }
Beispiel #5
0
 public static void Register(IUpdating t, bool autoDispose = false)
 {
     Load();
     instance.clients.Add(t);
     if (autoDispose)
     {
         SceneLoadDisposal.Add(t);
     }
 }
Beispiel #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);
            }
        }
Beispiel #8
0
 public static void Unregister(IUpdating t)
 {
     Load();
     instance.clients.Remove(t);
 }
 public UpdatingContainer(IUpdating updatingObject, GetFunction function)
 {
     this.updatingObject = updatingObject;
     Function            = function;
 }
Beispiel #10
0
 public Rendering(IUpdating trackUpdate, IOutput output)
 {
     _output = output;
     trackUpdate.TracksUpdated += RenderTracks;
 }
Beispiel #11
0
 public void Add(IUpdating u) => bindings.Add(u);
Beispiel #12
0
 public static void Add(IUpdating alpha)
 {
     updating.Add(alpha);
 }
Beispiel #13
0
 public static void Add(IUpdating alpha)
 {
     updating.Add(alpha);
 }