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
Gets the number of elements contained in this dictionary
public int Count { get; }

IsReadOnly

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

Keys

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

Values

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

Indexers

this[]

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

Methods

Add

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

Add

#
Adds an item to this dictionary.
public void Add(
item
The object to add to this dictionary
)
ArgumentNullExceptionvalue is null.
ArgumentExceptionkey is empty.

Clear

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

Contains

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

ContainsKey

#Since v5.10
Determines whether this dictionary contains an MaterialRef with the specified plug-in id.
public bool ContainsKey(
key
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

#
Copies the elements of this dictionary to an System.Array, starting at a particular System.Array index.
public void CopyTo(
array,
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
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
Call this method to create a MaterialRef which can be used when calling one of the Add methods.
public MaterialRef Create(
createParams
Values used to initialize the MaterialRef
)
A temporary MaterialRef object, the caller is responsible for disposing of this object.

GetEnumerator

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

Remove

#Since v5.10
Removes the MaterialRef with the specified plug-in Id from this dictionary.
public bool Remove(
key
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

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

IEnumerable.GetEnumerator

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

TryGetValue

#Since v5.10
Gets the value associated with the specified key.
public bool TryGetValue(
key,
The plug-in Id whose MaterialRef to get.
value
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.