2002-07-31 Duncan Mak <duncan@ximian.com>
[mono.git] / mcs / class / corlib / System.Runtime.Remoting / WellKnownClientTypeEntry.cs
1 //
2 // System.Runtime.Remoting.WellKnownClientTypeEntry.cs
3 //
4 // AUthor: Duncan Mak  (duncan@ximian.com)
5 //
6 // 2002 (C) Copyright. Ximian, Inc.
7 //
8
9 using System;
10 using System.Reflection;
11
12 namespace System.Runtime.Remoting {
13
14         public class WellKnownClientTypeEntry : TypeEntry
15         {
16                 Type obj_type;
17                 string obj_url;
18                 string app_url = null;
19                 
20                 public WellKnownClientTypeEntry (Type type, string objectUrl )
21                 {
22                         AssemblyName = type.Assembly.FullName;
23                         TypeName = type.FullName;
24                         obj_type = type;
25                         obj_url = objectUrl;
26                 }
27
28                 public WellKnownClientTypeEntry (string typeName, string assemblyName, string objectUrl)
29                 {
30                         AssemblyName = assemblyName;
31                         TypeName = typeName;
32                         Assembly a = Assembly.Load (assemblyName);
33                         obj_type = a.GetType (typeName);
34                 }
35
36                 public string ApplicationUrl {
37                         get { return app_url; }
38                         set { app_url = value; }
39                 }
40
41                 public Type ObjectType {
42                         get { return obj_type; }
43                 }
44
45                 public string ObjectUrl {
46                         get { return obj_url; }
47                         set { obj_url = value; }
48                 }
49
50                 public override string ToString ()
51                 {
52                         if (ApplicationUrl != null)
53                                 return TypeName + AssemblyName + ObjectUrl + ApplicationUrl;
54                         else
55                                 return TypeName + AssemblyName + ObjectUrl;
56                 }
57         }
58 }