mscorlib(4.0.0.0) API with additions
UrlAttribute.cs
3 using System.Security;
4 
6 {
9  [SecurityCritical]
10  [ComVisible(true)]
11  public sealed class UrlAttribute : ContextAttribute
12  {
13  private string url;
14 
15  private static string propertyName = "UrlAttribute";
16 
20  public string UrlValue
21  {
22  [SecurityCritical]
23  get
24  {
25  return url;
26  }
27  }
28 
33  [SecurityCritical]
34  public UrlAttribute(string callsiteURL)
35  : base(propertyName)
36  {
37  if (callsiteURL == null)
38  {
39  throw new ArgumentNullException("callsiteURL");
40  }
41  url = callsiteURL;
42  }
43 
49  [SecuritySafeCritical]
50  public override bool Equals(object o)
51  {
52  if (o is IContextProperty && o is UrlAttribute)
53  {
54  return ((UrlAttribute)o).UrlValue.Equals(url);
55  }
56  return false;
57  }
58 
62  [SecuritySafeCritical]
63  public override int GetHashCode()
64  {
65  return url.GetHashCode();
66  }
67 
74  [SecurityCritical]
75  [ComVisible(true)]
76  public override bool IsContextOK(Context ctx, IConstructionCallMessage msg)
77  {
78  return false;
79  }
80 
84  [SecurityCritical]
85  [ComVisible(true)]
87  {
88  }
89  }
90 }
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Represents the construction call request of an object.
Gathers naming information from the context property and determines whether the new context is ok for...
Definition: __Canon.cs:3
override bool IsContextOK(Context ctx, IConstructionCallMessage msg)
Returns a Boolean value that indicates whether the specified T:System.Runtime.Remoting....
Definition: UrlAttribute.cs:76
override bool Equals(object o)
Checks whether the specified object refers to the same URL as the current instance.
Definition: UrlAttribute.cs:50
Defines an environment for the objects that are resident inside it and for which a policy can be enfo...
Definition: Context.cs:14
UrlAttribute(string callsiteURL)
Creates a new instance of the T:System.Runtime.Remoting.Activation.UrlAttribute class.
Definition: UrlAttribute.cs:34
string UrlValue
Gets the URL value of the T:System.Runtime.Remoting.Activation.UrlAttribute.
Definition: UrlAttribute.cs:21
override void GetPropertiesForNewContext(IConstructionCallMessage ctorMsg)
Forces the creation of the context and the server object inside the context at the specified URL.
Definition: UrlAttribute.cs:86
override int GetHashCode()
Returns the hash value for the current T:System.Runtime.Remoting.Activation.UrlAttribute.
Definition: UrlAttribute.cs:63
Specifies that the class can be serialized.
Defines an attribute that can be used at the call site to specify the URL where the activation will h...
Definition: UrlAttribute.cs:11
Provides the default implementations of the T:System.Runtime.Remoting.Contexts.IContextAttribute and ...