Click or drag to resize
DigitalRuneParticleParameterCollection Class
Manages a collection of particle parameters.
Inheritance Hierarchy
SystemObject
  DigitalRune.ParticlesParticleParameterCollection

Namespace: DigitalRune.Particles
Assembly: DigitalRune.Particles (in DigitalRune.Particles.dll) Version: 1.4.0.0 (1.4.1.14427)
Syntax
public class ParticleParameterCollection : IEnumerable<IParticleParameter>, 
	IEnumerable

The ParticleParameterCollection type exposes the following members.

Methods
  NameDescription
Public methodAddUniformT
Adds a uniform particle parameter.
Public methodAddVaryingT
Adds a varying particle parameter.
Public methodClear
Removes all particle parameters in this collection.
Public methodContains
Determines whether the collection contains a particle parameter with the given name.
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 methodGetT(String)
Gets a particle parameter with the specified type and name. (If the type is wrong an exception is thrown.)
Public methodGetT(String, Boolean)
Gets a particle parameter with the specified type and name. (If the type is wrong an exception is thrown.)
Public methodGetEnumerator
Returns an enumerator that iterates through the ParticleParameterCollection.
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.)
Public methodGetUncheckedT(String)
Gets a particle parameter with the specified type and name. (If the type is wrong is returned.)
Public methodGetUncheckedT(String, Boolean)
Gets a particle parameter with the specified type and name. (If the type is wrong is returned.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnChanged
Raises the Changed event.
Public methodRemove
Removes a particle parameter.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodDoIParticleParameter(ActionIParticleParameter)Overloaded.
Performs the given action on each element in a sequence when it is enumerated.
(Defined by LinqHelper.)
Public Extension MethodDoIParticleParameter(ActionIParticleParameter, Int32)Overloaded.
Performs the given action on each element (incorporating its index) in a sequence when it is enumerated.
(Defined by LinqHelper.)
Public Extension MethodForEachIParticleParameter(ActionIParticleParameter)Overloaded.
Immediately performs the given action on each element in a sequence.
(Defined by LinqHelper.)
Public Extension MethodForEachIParticleParameter(ActionIParticleParameter, Int32)Overloaded.
Immediately performs the given action on each element (incorporating its index) in a sequence.
(Defined by LinqHelper.)
Public Extension MethodIndexOfIParticleParameter
Returns the index of the first element in a sequence that satisfies the specified condition.
(Defined by LinqHelper.)
Top
Properties
  NameDescription
Public propertyParticleSystem
Gets the particle system that owns this particle parameter collection.
Top
Events
  NameDescription
Public eventChanged
Occurs when the collection was modified.
Top
Explicit Interface Implementations
Remarks

This collection manages the particle parameters of a particle system. All parameters must have a unique name ( or empty strings are not allowed).

New particle parameters can be added using the methods AddUniformT(String) and AddVaryingT(String). If a particle parameter with the given name already exists, AddUniformT(String) returns the existing parameter and does nothing else - even if the existing parameter is varying. If a particle parameter with the given name already exists, AddVaryingT(String) returns the existing parameter if it is varying. But if the existing parameter is uniform, AddVaryingT(String) replaces the existing parameter. - This means: Calling AddUniformT(String) and AddVaryingT(String) multiple times is safe. Varying parameters have higher priority and replace uniform parameters.

The generic methods AddUniformT(String), AddVaryingT(String) and GetT(String) throw an ParticleSystemException if a particle parameter with the given name exists but the particle parameter type is different. The method GetUncheckedT(String) is the same as GetT(String, Boolean), except that it does not throw an exception. It returns if the requested particle parameter does not exist or the type does not match.

Parameter Inheritance:
Per default, the Get() methods also search for uniform (but not varying) parameters in the particle parameter collections of parent particle systems if a parameter is not found in this collection. This means that uniform parameters are automatically inherited by child particle systems. Note that enumerating the collection (using GetEnumerator) only returns the locally stored particle parameters, i.e. inherited parameters are not included in the enumeration.

Objects that manipulate particle parameters can hold references to the IParticleParameter instances. The event Changed is raised when the collection is modified. In this case any references to particle parameters get invalid. - The particle parameters could have been replaced or removed. (ParticleEffectors do not need to subscribe to the Changed event. They will automatically be updated by the ParticleSystem that owns them.)

See Also