diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/MarshalByRefType.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/MarshalByRefType.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/MarshalByRefType.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/MarshalByRefType.cs new file mode 100644 index 0000000..36bb146 --- /dev/null +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/MarshalByRefType.cs | |||
@@ -0,0 +1,34 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using System.Threading; | ||
5 | |||
6 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | ||
7 | { | ||
8 | // Because this class is derived from MarshalByRefObject, a proxy | ||
9 | // to a MarshalByRefType object can be returned across an AppDomain | ||
10 | // boundary. | ||
11 | public class MarshalByRefType : MarshalByRefObject | ||
12 | { | ||
13 | // Call this method via a proxy. | ||
14 | public void SomeMethod(string callingDomainName) | ||
15 | { | ||
16 | // Get this AppDomain's settings and display some of them. | ||
17 | AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation; | ||
18 | Console.WriteLine("AppName={0}, AppBase={1}, ConfigFile={2}", | ||
19 | ads.ApplicationName, | ||
20 | ads.ApplicationBase, | ||
21 | ads.ConfigurationFile | ||
22 | ); | ||
23 | |||
24 | // Display the name of the calling AppDomain and the name | ||
25 | // of the second domain. | ||
26 | // NOTE: The application's thread has transitioned between | ||
27 | // AppDomains. | ||
28 | Console.WriteLine("Calling from '{0}' to '{1}'.", | ||
29 | callingDomainName, | ||
30 | Thread.GetDomain().FriendlyName | ||
31 | ); | ||
32 | } | ||
33 | } | ||
34 | } | ||