3 // Copyright (c) Microsoft Corporation. All rights reserved.
6 /*============================================================
8 ** File: UrlAttribute.cs
10 ** <EMAIL>Author: Tarun Anand (Microsoft)</EMAIL>
12 ** Purpose: Defines an attribute which can be used at the callsite to
13 ** specify the URL at which the activation will happen.
15 ** Date: Microsoft 30, 2000
17 ===========================================================*/
18 namespace System.Runtime.Remoting.Activation {
19 using System.Runtime.Remoting;
20 using System.Runtime.Remoting.Contexts;
21 using System.Runtime.Remoting.Messaging;
22 using System.Security.Permissions;
24 [System.Security.SecurityCritical] // auto-generated
26 [System.Runtime.InteropServices.ComVisible(true)]
27 public sealed class UrlAttribute : ContextAttribute
30 private static String propertyName = "UrlAttribute";
32 [System.Security.SecurityCritical] // auto-generated_required
33 public UrlAttribute(String callsiteURL) :base(propertyName)
35 if(null == callsiteURL)
38 throw new ArgumentNullException("callsiteURL");
45 // Override the default implementation which just compares the names
46 [System.Security.SecuritySafeCritical] // overrides public transparent member
47 public override bool Equals(Object o)
49 return (o is IContextProperty) && (o is UrlAttribute) &&
50 (((UrlAttribute)o).UrlValue.Equals(url));
53 [System.Security.SecuritySafeCritical] // overrides public transparent member
54 public override int GetHashCode()
56 return this.url.GetHashCode();
59 // Override ContextAttribute's implementation of IContextAttribute::IsContextOK
60 [System.Security.SecurityCritical] // auto-generated_required
61 [System.Runtime.InteropServices.ComVisible(true)]
62 public override bool IsContextOK(Context ctx, IConstructionCallMessage msg)
67 // Override ContextAttribute's impl. of IContextAttribute::GetPropForNewCtx
68 [System.Security.SecurityCritical] // auto-generated_required
69 [System.Runtime.InteropServices.ComVisible(true)]
70 public override void GetPropertiesForNewContext(IConstructionCallMessage ctorMsg)
72 // We are not interested in contributing any properties to the
73 // new context since the only purpose of this property is to force
74 // the creation of the context and the server object inside it at
79 public String UrlValue
81 [System.Security.SecurityCritical] // auto-generated_required