Class ListComWrapper<T>
List for COM wrappers - correctly adds and removes items. Also disposes all items on Dispose call
Inheritance
ListComWrapper<T>
Assembly: CAMAPI.DotnetHelper.dll
Syntax
public class ListComWrapper<T> : IList<ComWrapper<T>>, ICollection<ComWrapper<T>>, IEnumerable<ComWrapper<T>>, IEnumerable, IDisposable
Type Parameters
Constructors
ListComWrapper()
Declaration
Properties
Count
Declaration
public int Count { get; }
Property Value
IsReadOnly
Always false - list is modifiable
Declaration
public bool IsReadOnly { get; }
Property Value
this[int]
Get or set item at index. Setting transfers ownership, so input item will no longer own the COM object
Declaration
public ComWrapper<T> this[int index] { get; set; }
Parameters
| Type |
Name |
Description |
| int |
index |
|
Property Value
Methods
Add(ComWrapper<T>)
Add item, transferring ownership, so input item will no longer own the COM object
Declaration
public void Add(ComWrapper<T> item)
Parameters
Examples
foreach (var coEdgeCom in loopCom.EnumerateCoEdges())
{
curves.Add(coEdgeCom.Geometry());
}
Clear()
Clear all items, disposing them
Declaration
Contains(ComWrapper<T>)
Compares items by equality of underlying COM objects
Declaration
public bool Contains(ComWrapper<T> item)
Parameters
Returns
CopyTo(ComWrapper<T>[], int)
Copy to array of COM wrappers, transferring ownership, so input array items will no longer own the COM objects
Declaration
public void CopyTo(ComWrapper<T>[] array, int arrayIndex)
Parameters
Dispose()
Dispose all items and clear the list
Declaration
GetEnumerator()
Enumerator over COM wrappers
Declaration
public IEnumerator<ComWrapper<T>> GetEnumerator()
Returns
IndexOf(ComWrapper<T>)
Compares items by equality of underlying COM objects
Declaration
public int IndexOf(ComWrapper<T> item)
Parameters
Returns
Insert(int, ComWrapper<T>)
Insert item at index, transferring ownership, so input item will no longer own the COM object
Declaration
public void Insert(int index, ComWrapper<T> item)
Parameters
Remove(ComWrapper<T>)
Removes item, comparing by equality of underlying COM objects. Disposes removed item.
Declaration
public bool Remove(ComWrapper<T> item)
Parameters
Returns
RemoveAt(int)
Remove item at index, disposing it
Declaration
public void RemoveAt(int index)
Parameters
| Type |
Name |
Description |
| int |
index |
|
Implements