Description Usage Arguments Details Examples
Sets a static property value from a .Net type name
1 | netSetStatic(typeName, propertyName, value)
|
typeName |
Full .Net type name |
propertyName |
Property name to set value |
value |
value to set. |
Allows you to set a property value from .Net type name.
The input value will be converted from R type to a .Net type.
If the property value isn't a native C# type or a mapped conversion type you have to use an external pointer on .Net object.
You can define custom converters in C# for that see RDotNetConverter
class.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
library(sharper)
pkgPath <- path.package("sharper")
f <- file.path(pkgPath, "tests", "AssemblyForTests.dll")
netLoadAssembly(f)
type <- "AssemblyForTests.StaticClass"
netSetStatic(type, "DoubleProperty", 1.23)
netGetStatic(type, "DoubleProperty")
netSetStatic(type, "Int32Property", 123L)
netGetStatic(type, "Int32Property")
netSetStatic(type, "DoubleArrayProperty", c(1.23, 1.24, 1.25))
netGetStatic(type, "DoubleArrayProperty")
netSetStatic(type, "Int32ArrayProperty", c(123L, 124L, 125L))
netGetStatic(type, "Int32ArrayProperty")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.