| Contents | Index |
Create instance of specialized .NET generic type
genObj = createGeneric(className,paramTypes,varargin
ctorArgs)
genObj = createGeneric(className,paramTypes,varargin ctorArgs) creates an instance genObj of generic type className.
| className | Fully qualified string with the generic type name. |
| paramTypes | Allowed cell types are: strings with fully qualified parameter type names and instances of the NET.GenericClass class when parameterization with another parameterized type is needed. |
| ctorArgs | Optional, variable length (0 to N) list of constructor arguments matching the arguments of the .NET generic class constructor intended to be invoked. |
| genObj | Handle to the specialized generic class instance. |
Create a strongly typed list dblLst of objects of type System.Double:
dblLst = NET.createGeneric('System.Collections.Generic.List',... {'System.Double'},10);
Create an instance of System.Collections.Generic.List of System.Collections.Generic.KeyValuePair generic associations.
Create the kvpType generic association where Key is of System.Int32 type and Value is a System.String:
kvpType = NET.GenericClass('System.Collections.Generic.KeyValuePair',... 'System.Int32','System.String');
Create the list kvpList with initial storage capacity for 10 key-value pairs:
kvpList = NET.createGeneric('System.Collections.Generic.List',... {kvpType},10);
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |