Click or drag to resize
DigitalRuneGamePropertyEventArgsT Class
Provides data for the Changing and the Changed event of a game object property.
Inheritance Hierarchy
SystemObject
  SystemEventArgs
    DigitalRune.GameGamePropertyEventArgs
      DigitalRune.GameGamePropertyEventArgsT

Namespace: DigitalRune.Game
Assembly: DigitalRune.Game (in DigitalRune.Game.dll) Version: 1.4.0.0 (1.4.0.14427)
Syntax
public class GamePropertyEventArgs<T> : GamePropertyEventArgs

Type Parameters

T
The type of the game object property value.

The GamePropertyEventArgsT type exposes the following members.

Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyCoercedValue
Gets or sets the coerced value.
Public propertyNewValue
Gets the new value of the game object property.
Public propertyOldValue
Gets the old value of the game object property.
Public propertyProperty
Gets the game object property.
Top
Remarks

These type of event arguments are passed to event handlers when the value of a game object property changes. This class stores the OldValue and the NewValue of the property. Event handlers of the Changing can set the CoercedValue to coerce the property to a corrected value. CoercedValue is not used in Changed events.

In detail: When the user calls a SetValue method of a GameObject the Changing event is raised (unless the new value is the same as the current property value). The OldValue of the event arguments is set to the current property value. NewValue and CoercedValue are set to the value that was specified in SetValue. The Changing event handlers can change the CoercedValue. After all Changing event handlers have been called the property value is set to the CoercedValue. After that, if the CoercedValue is different from the OldValue, the Changed event is raised. In the event arguments the OldValue is the same as in the Changing event. NewValue is set to the new property value (which is the coerced value). CoercedValue is not used in Changed events.

Important: Event handlers of the Changing and Changed events should not directly change the game object property using a SetValue method. This can result in unexpected behavior. The CoercedValue property of this event arguments can be used instead.

See Also