System.Runtime.Remoting.Activation.UrlAttribute Class

Assembly: Mscorlib.dll
Namespace: System.Runtime.Remoting.Activation
Summary
Defines an attribute that can be used at the call site to specify the URL where the activation will happen. This class cannot be inherited.
C# Syntax:
[Serializable]
public sealed class UrlAttribute : ContextAttribute
Remarks
The UrlAttribute is passed in the activation attributes array as a parameter to Activator.CreateInstance when creating activated objects with the Activator.CreateInstance method.

For more information about using attributes, see the conceptual topic at MSDN: extendingmetadatausingattributes.

See also:
System.Runtime.Remoting.Activation Namespace | ContextAttribute | IContextProperty

System.Runtime.Remoting.Activation.UrlAttribute Member List:

Public Constructors
ctor #1 Creates a new instance of the UrlAttribute class.
Public Properties
Name  (inherited) Read-only

See base class member description: System.Runtime.Remoting.Contexts.IContextProperty.Name


Gets the name of the property under which it will be added to the context.
TypeId
(inherited from System.Attribute)
Read-only

See base class member description: System.Attribute.TypeId


When implemented in a derived class, gets a unique identifier for this Attribute.
UrlValue Read-only

Gets the URL value of the UrlAttribute.
Public Methods
Equals Overridden:
Checks whether the specified object refers to the same URL as the current instance.
Freeze  (inherited) See base class member description: System.Runtime.Remoting.Contexts.IContextProperty.Freeze


Called when the context is frozen.
GetHashCode Overridden:
Returns the hash value for the current UrlAttribute.
GetPropertiesForNewContext Overridden:
Forces the creation of the context and the server object inside the context at the specified URL.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
IsContextOK Overridden:
Returns a Boolean value indicating whether the specified Context meets UrlAttribute 's requirements.
IsDefaultAttribute
(inherited from System.Attribute)
See base class member description: System.Attribute.IsDefaultAttribute


When overridden in a derived class, returns an indication whether the value of this instance is the default value for the derived class.
IsNewContextOK  (inherited) See base class member description: System.Runtime.Remoting.Contexts.IContextProperty.IsNewContextOK


Returns a Boolean value indicating whether the context property is OK with the new context.
Match
(inherited from System.Attribute)
See base class member description: System.Attribute.Match


When overridden in a derived class, returns a value indicating whether this instance equals a specified object.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Protected Fields
AttributeName  (inherited) This member is inherited from a type or implements a member of an interface which internally supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Runtime.Remoting.Activation.UrlAttribute Member Details

ctor #1
Summary
Creates a new instance of the UrlAttribute class.
C# Syntax:
public UrlAttribute(
   string callsiteURL
);
Parameters:

callsiteURL

The call site URL.

Exceptions
Exception Type Condition
ArgumentNullException The callsiteURL parameter is null.

Return to top


Field: AttributeName
Inherited
This member is inherited from a type or implements a member of an interface which internally supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Return to top


Property: Name (read-only)
Inherited
See base class member description: System.Runtime.Remoting.Contexts.IContextProperty.Name

Summary
Gets the name of the property under which it will be added to the context.
C# Syntax:
string Name {get;}

Return to top


Property: TypeId (read-only)
Inherited
See base class member description: System.Attribute.TypeId

Summary
When implemented in a derived class, gets a unique identifier for this Attribute.
C# Syntax:
public virtual object TypeId {get;}
Remarks
As implemented, this identifier is merely the Type of the attribute. However, it is intended that the unique identifier be used to identify two attributes of the same type.

Return to top


Property: UrlValue (read-only)
Summary
Gets the URL value of the UrlAttribute.
C# Syntax:
public string UrlValue {get;}

Return to top


Overridden Method: Equals(
   object o
)
Summary
Checks whether the specified object refers to the same URL as the current instance.
C# Syntax:
public override bool Equals(
   object o
);
Parameters:

o

The object to compare to the current UrlAttribute. The object to compare to the current UrlAttribute.

Return Value:
true if the object is a UrlAttribute with the same value; otherwise, false.
Remarks
This method overrides the default Object.Equals method.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~UrlAttribute();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Freeze(
   Context newContext
)
Inherited
See base class member description: System.Runtime.Remoting.Contexts.IContextProperty.Freeze

Summary
Called when the context is frozen.
C# Syntax:
void Freeze(
   Context newContext
);
Parameters:

newContext

The context to freeze.

Remarks
Context properties cannot be added after the context has been frozen.

Return to top


Overridden Method: GetHashCode()
Summary
Returns the hash value for the current UrlAttribute.
C# Syntax:
public override int GetHashCode();
Return Value:
The hash value for the current UrlAttribute.

Return to top


Overridden Method: GetPropertiesForNewContext(
   IConstructionCallMessage ctorMsg
)
Summary
Forces the creation of the context and the server object inside the context at the specified URL.
C# Syntax:
public override void GetPropertiesForNewContext(
   IConstructionCallMessage ctorMsg
);
Parameters:

ctorMsg

The IConstructionCallMessage of the server object to create.

Implements:
IContextAttribute.GetPropertiesForNewContext
Remarks
UrlAttribute.GetPropertiesForNewContext does not contribute any properties to the new context because it is used by the Remoting infrastructure to force the creation of the context and the server object inside the context at the specified URL.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Overridden Method: IsContextOK(
   Context ctx,
   IConstructionCallMessage msg
)
Summary
Returns a Boolean value indicating whether the specified Context meets UrlAttribute 's requirements.
C# Syntax:
public override bool IsContextOK(
   Context ctx,
   IConstructionCallMessage msg
);
Parameters:

ctx

The context to check against the current context attribute.

msg

The construction call, the parameters of which need to be checked against the current context.

Return Value:
true if the passed in context is OK; otherwise, false.
Implements:
IContextAttribute.IsContextOK
See also:
Context

Return to top


Method: IsDefaultAttribute()
Inherited
See base class member description: System.Attribute.IsDefaultAttribute

Summary
When overridden in a derived class, returns an indication whether the value of this instance is the default value for the derived class.
C# Syntax:
public virtual bool IsDefaultAttribute();
Return Value:
true if this instance is the default attribute for the class; otherwise, false.
Remarks
The default implementation of this class returns false, and must be implemented in the derived class to be useful to that class.

The implementation of this method in a derived class compares the value of this instance to a standard, default value obtained by some means, then returns a Boolean value that indicates whether the value of this instance is equal to the standard. The standard value is typically coded as a constant in the implementation, or stored programmatically in a field used by the implementation.

Return to top


Method: IsNewContextOK(
   Context newCtx
)
Inherited
See base class member description: System.Runtime.Remoting.Contexts.IContextProperty.IsNewContextOK

Summary
Returns a Boolean value indicating whether the context property is OK with the new context.
C# Syntax:
bool IsNewContextOK(
   Context newCtx
);
Parameters:

newCtx

The new Context in which the ContextProperty has been created.

Return Value:
true if the context property can coexist with the other context properties in the given context; false otherwise.
Remarks
Once all the context properties have been added to the new context, they are all asked whether they are OK in the new context. The context property could look at the other context properties from the parameter new context and determine whether it is compatible with these other context properties. Returns false if not OK in the context.

Return to top


Method: Match(
   object obj
)
Inherited
See base class member description: System.Attribute.Match

Summary
When overridden in a derived class, returns a value indicating whether this instance equals a specified object.
C# Syntax:
public virtual bool Match(
   object obj
);
Parameters:

obj

An Object to compare with this instance of Attribute.

Return Value:
true if this instance equals obj; otherwise, false.
Remarks
This method determines if one Attribute equals another. Its default implementation is the same as Attribute.Equals, which performs a value and reference comparison. Override this method to implement support for attribute values, such as flags or bitfields, that consist of components that are meaningful in themselves. For example, consider an attribute whose value is a binary field divided into a bitfield of flags. Two instances of this attribute have one flag in set in common while all the other flags differ. The Equal method cannot determine that the two instances have the same flag set, but the Match method can.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.