MaterialRefs

References
If you are developing a high quality plug-in renderer, and a user is assigning a custom render material to this object, then add rendering material information to the MaterialRefs dictionary. Note to developers: As soon as the MaterialRefs dictionary contains items rendering material queries slow down. Do not populate the MaterialRefs dictionary when setting the MaterialIndex will take care of your needs.

Properties

Count

#Since v5.10
public int Count { get; }
Gets the number of elements contained in this dictionary

IsReadOnly

#Since v5.10
public bool IsReadOnly { get; }
IDictionary required property, always returns false for this dictionary.

Keys

#Since v5.10
public ICollection<Guid> Keys { get; }
Gets an ICollection containing the plug-in Id's in this dictionary.

Values

#Since v5.10
public ICollection<MaterialRef> Values { get; }
Gets an ICollection containing the MaterialRef objects in this dictionary.

Indexers

this[]

#
public MaterialRef this[Guid key] { get; set; }
Gets or sets the element with the specified plug-in Id.
key (Guid)The plug-in Id of the MaterialRef to get or set.
The MaterialRef with the specified key.
ArgumentNullExceptionvalue is null.
ArgumentExceptionkey is empty.

Methods

Add

#Since v5.10
public void Add(Guid key, MaterialRef value)
Add or replace an element with the provided key and value to this dictionary.
key (Guid)The plug-in associated with this MaterialRef
value (MaterialRef)MaterialRef to add to this dictionary
ArgumentNullExceptionvalue is null.
ArgumentExceptionkey is empty.

Add

#
public void Add(KeyValuePair<Guid, MaterialRef> item)
Adds an item to this dictionary.
item (KeyValuePair<Guid, MaterialRef>)The object to add to this dictionary
ArgumentNullExceptionvalue is null.
ArgumentExceptionkey is empty.

Clear

#Since v5.10
public void Clear()
Removes all items from this dictionary.

Contains

#
public bool Contains(KeyValuePair<Guid, MaterialRef> item)
Determines whether this dictionary contains a specific value.
item (KeyValuePair<Guid, MaterialRef>)The object to locate in this dictionary.
true if item is found in this dictionary; otherwise, false.

ContainsKey

#Since v5.10
public bool ContainsKey(Guid key)
Determines whether this dictionary contains an MaterialRef with the specified plug-in id.
key (Guid)The plug-in Id used to locate a MaterialRef in this dictionary.
true if this dictionary contains an element with the specified plug-in Id; otherwise, false.

CopyTo

#
public void CopyTo(KeyValuePair<Guid, MaterialRef>[] array, int arrayIndex)
Copies the elements of this dictionary to an System.Array, starting at a particular System.Array index.
array (KeyValuePair<Guid, MaterialRef>[])The one-dimensional System.Array that is the destination of the elements copied from this dictionary. The System.Array must have zero-based indexing.
arrayIndex (int)The zero-based index in array at which copying begins.
ArgumentNullExceptionarray is null
ArgumentOutOfRangeExceptionarrayIndex is less than 0.
ArgumentOutOfRangeExceptionThe number of elements in the source dictionary is greater than the available space from arrayIndex to the end of the destination array.

Create

#Since v5.10
public MaterialRef Create(MaterialRefCreateParams createParams)
Call this method to create a MaterialRef which can be used when calling one of the Add methods.
createParams (MaterialRefCreateParams)Values used to initialize the MaterialRef
A temporary MaterialRef object, the caller is responsible for disposing of this object.

GetEnumerator

#Since v5.10
public IEnumerator<KeyValuePair<Guid, MaterialRef>> GetEnumerator()
Returns an enumerator that iterates through this dictionary.
A IEnumerator that can be used to iterate this dictionary.

Remove

#Since v5.10
public bool Remove(Guid key)
Removes the MaterialRef with the specified plug-in Id from this dictionary.
key (Guid)The plug-in Id for the MaterialRef to remove.
true if the MaterialRef is successfully removed; otherwise, false. This method also returns false if key was not found in the original dictionary.

Remove

#
public bool Remove(KeyValuePair<Guid, MaterialRef> item)
Removes the element with the specified plug-in id from the this dictionary.
item (KeyValuePair<Guid, MaterialRef>)The object to remove from this dictionary
Explicit

IEnumerable.GetEnumerator

#Since v5.10
IEnumerator IEnumerable.GetEnumerator()
Returns an enumerator that iterates through this dictionary.
An System.Collections.IEnumerator object that can be used to iterate through this dictionary.

TryGetValue

#Since v5.10
public bool TryGetValue(Guid key, out MaterialRef value)
Gets the value associated with the specified key.
key (Guid)The plug-in Id whose MaterialRef to get.
value (out MaterialRef)When this method returns, the MaterialRef associated with the specified key, if the key is found; otherwise, null. This parameter is passed uninitialized.
true if this dictionary contains a MaterialRef with the specified key; otherwise, false.