BasicNoUIObjAddSafeReference Method |
Extends the WWB.NET language using an assembly reference.
Namespace: WinWrap.Basic.ServerAssembly: WinWrap.Basic.Server (in WinWrap.Basic.Server.dll)
Syntaxpublic bool AddSafeReference(
Assembly assembly,
string? imports = null
)
Public Function AddSafeReference (
assembly As Assembly,
Optional imports As String = Nothing
) As Boolean
public:
virtual bool AddSafeReference(
Assembly^ assembly,
String^ imports = nullptr
) sealed
Parameters
- assembly Assembly
-
Add this reference to the WWB.NET language.
- imports String (Optional)
-
All macros are parsed with automatic Imports for each import in the string.
(Separate imports with a space.)
To add a safe reference to a specific module prefix it with "modulepath|".
Return Value
Boolean
True if
AddSafeReference is successful.
Implements
IBasicNoUIAddSafeReference(Assembly, String)
Remarks2025-01-24: This method does not use the SandBoxRules at this time.
The WWB.NET language is extended using the assembly with automatic imports.
Only public types and members are accessible.
All accessible types and members are considered safe for sandboxing.
Use RemoveExtensions("") to remove all the references and automatic imports.
Example
Add an assembly and automatic Imports:
basicIdeCtl1.AddSafeReference(typeof(MyAssembly.MyType).Assembly,
"MyAssembly");
BasicIdeCtl1.AddSafeReference(GetType(MyAssembly.MyType).Assembly,
"MyAssembly")
basicIdeCtl1->AddSafeReference(typeof(MyAssembly.MyType)->Assembly,
"MyAssembly");
See Also