netNew: Instanciate a .Net object

Description Usage Arguments Details Value Examples

View source: R/netNew.R

Description

Instanciate a .Net object from its type name.

Usage

1
netNew(typeName, ...)

Arguments

typeName

The .Net full name type

...

.Net Constructor arguments.

Details

The typeName should respect the full type name convention: Namespace.TypeName Ellipses ... has to keep the .net constructor arguments order, the named arguments are not supported yet. If there is many constructors defined for the given .Net type, a score selection is computed from your arguments orders and types to choose the best one. We consider as a higher priority single value compare to collection of values.

Value

Returns a converted .Net instance if a converter is defined, an external pointer otherwise.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
library(sharper)

package_folder <- path.package("sharper")
netLoadAssembly(file.path(package_folder, "tests", "RDotNet.AssemblyTest.dll"))

x <- netNew("RDotNet.AssemblyTest.OneCtorData", 21L)
netCall(x, "ToString")

## End(Not run)

fdieulle/sharper documentation built on Aug. 1, 2020, 4:19 p.m.