Class SoAppDomain
Implements
Inherited Members
Namespace: SuperOffice.ApplicationDomain
Assembly: SoCore.dll
Syntax
public class SoAppDomain : MarshalByRefObject, IDisposable
Methods
CallStaticMethod(String, String, Type[], Object[])
Returns the result of a static method call
Declaration
public object CallStaticMethod(string typeName, string methodName, Type[] parameterTypes, object[] methodParams)
Parameters
Type | Name | Description |
---|---|---|
String | typeName | The type to call the static method on |
String | methodName | Name of the method to call |
Type[] | parameterTypes | Type array containing the type of the parameters. |
Object[] | methodParams | The parameters to pass to the method |
Returns
Type | Description |
---|---|
Object | The return value of the method |
Examples
//How to create an appdomain and call a static method in the created appdomain.
PolicyLevel policy = PolicyLevel.CreateAppDomainLevel();
SoAppDomain soAppDomain = new SoAppDomain(policy);
soAppDomain.CallStaticMethod("SuperOffice.Events.SoEventManager", "SendEvent",
new Type[] {
typeof(String),
typeof(Boolean),
typeof(Object).MakeByRefType(), //Object is ref object
typeof(SuperOffice.Events.SendEventArguments) },
new object[] {
"test", false, null, null });
CallStaticMethodByRefParams(String, String, Type[], ref Object[])
Returns the result of a static method call
Declaration
public object CallStaticMethodByRefParams(string typeName, string methodName, Type[] parameterTypes, ref object[] methodParams)
Parameters
Type | Name | Description |
---|---|---|
String | typeName | The type to call the static method on |
String | methodName | Name of the method to call |
Type[] | parameterTypes | Type array containing the type of the parameters. |
Object[] | methodParams | The parameters to pass to the method |
Returns
Type | Description |
---|---|
Object | The return value of the method |
Examples
//How to create an appdomain and call a static method in the created appdomain.
PolicyLevel policy = PolicyLevel.CreateAppDomainLevel();
SoAppDomain soAppDomain = new SoAppDomain(policy);
soAppDomain.CallStaticMethod("SuperOffice.Events.SoEventManager", "SendEvent",
new Type[] {
typeof(String),
typeof(Boolean),
typeof(Object).MakeByRefType(), //Object is ref object
typeof(SuperOffice.Events.SendEventArguments) },
new object[] {
"test", false, null, null });
CreateDefault(String)
Create a default appdomain
Declaration
public static SoAppDomain CreateDefault(string applicationName)
Parameters
Type | Name | Description |
---|---|---|
String | applicationName | Assigns a friendly name for the new appdomain. |
Returns
Type | Description |
---|---|
SoAppDomain |
CreateInstance(String, BindingFlags, Object[])
Returns a proxy to an instance of the specified plugin type
Declaration
public MarshalByRefObject CreateInstance(string typeName, BindingFlags bindingFlags, object[] constructorParams)
Parameters
Type | Name | Description |
---|---|---|
String | typeName | The name of the type to create an instance of |
BindingFlags | bindingFlags | The binding flags for the constructor |
Object[] | constructorParams | The parameters to pass to the constructor |
Returns
Type | Description |
---|---|
MarshalByRefObject | The constructed object |
CreateScriptAppDomain(String)
Create an AppDomain for the scripting engine.
Declaration
public static SoAppDomain CreateScriptAppDomain(string applicationName)
Parameters
Type | Name | Description |
---|---|---|
String | applicationName | Assigns a friendly name for the new appdomain. |
Returns
Type | Description |
---|---|
SoAppDomain |
Dispose()
Unload the appdomain
Declaration
public void Dispose()
InitAppDomain(String)
Default constructor. Initialize and create a new appdomain.
Declaration
protected void InitAppDomain(string applicationName)
Parameters
Type | Name | Description |
---|---|---|
String | applicationName | Assigns a friendly name for the new appdomain. |
LoadAssembly(String)
Loads the specified assembly
Declaration
public void LoadAssembly(string filename)
Parameters
Type | Name | Description |
---|---|---|
String | filename | The filename of the assembly to load |