Exemplo n.º 1
0
 /// <summary>
 /// Handles the needed event-calls before updating.
 /// </summary>
 private void OnUpdating(IUpdateTrigger trigger, CustomUpdateData customData)
 {
     try
     {
         double deltaTime = _deltaTimeCounter.Elapsed.TotalSeconds;
         _deltaTimeCounter.Restart();
         Updating?.Invoke(new UpdatingEventArgs(deltaTime, trigger, customData));
     }
     catch { /* Well ... that's not my fault */ }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Event handler for the <see cref="IUpdateTrigger.Update"/>-event.
        /// </summary>
        /// <param name="sender">The <see cref="IUpdateTrigger"/> causing this update.</param>
        /// <param name="customData"><see cref="CustomUpdateData"/> provided by the trigger.</param>
        protected virtual void OnUpdate(object sender, CustomUpdateData customData)
        {
            Dictionary <TIdentifier, TData> dataSet;

            lock (_dataLock)
            {
                dataSet         = _currentDataSet;
                _currentDataSet = null;
            }

            if ((dataSet != null) && (dataSet.Count != 0))
            {
                Update(dataSet);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Event handler for the <see cref="IUpdateTrigger.Starting"/>-event.
 /// </summary>
 /// <param name="sender">The starting <see cref="IUpdateTrigger"/>.</param>
 /// <param name="customData"><see cref="CustomUpdateData"/> provided by the trigger.</param>
 protected virtual void OnStartup(object sender, CustomUpdateData customData)
 {
 }
Exemplo n.º 4
0
 /// <summary>
 /// Invokes the <see cref="Update"/>-event.
 /// </summary>
 /// <param name="updateData">Optional custom-data passed to the subscribers of the <see cref="Update"/>.event.</param>
 protected virtual void OnUpdate(CustomUpdateData updateData = null) => Update?.Invoke(this, updateData);
Exemplo n.º 5
0
 /// <summary>
 /// Invokes the <see cref="Starting"/>-event.
 /// </summary>
 /// <param name="updateData">Optional custom-data passed to the subscribers of the <see cref="Starting"/>.event.</param>
 protected virtual void OnStartup(CustomUpdateData updateData = null) => Starting?.Invoke(this, updateData);
Exemplo n.º 6
0
 /// <inheritdoc />
 /// <summary>
 /// Initializes a new instance of the <see cref="T:RGB.NET.Core.UpdatingEventArgs" /> class.
 /// </summary>
 /// <param name="deltaTime">The elapsed time (in seconds) since the last update.</param>
 /// <param name="trigger">The trigger causing this update.</param>
 /// <param name="customData">The custom-data provided by the trigger for this update.</param>
 public UpdatingEventArgs(double deltaTime, IUpdateTrigger trigger, CustomUpdateData customData)
 {
     this.DeltaTime  = deltaTime;
     this.Trigger    = trigger;
     this.CustomData = customData;
 }