Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Runtime / Remoting / URLAttribute.cs / 1 / URLAttribute.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*============================================================
**
** File: UrlAttribute.cs
**
** Author: Tarun Anand (TarunA)
**
** Purpose: Defines an attribute which can be used at the callsite to
** specify the URL at which the activation will happen.
**
** Date: March 30, 2000
**
===========================================================*/
namespace System.Runtime.Remoting.Activation {
using System.Runtime.Remoting;
using System.Runtime.Remoting.Contexts;
using System.Runtime.Remoting.Messaging;
using System.Security.Permissions;
using System;
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class UrlAttribute : ContextAttribute
{
private String url;
private static String propertyName = "UrlAttribute";
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.Infrastructure)]
public UrlAttribute(String callsiteURL) :base(propertyName)
{
if(null == callsiteURL)
{
// Invalid arg
throw new ArgumentNullException("callsiteURL");
}
url = callsiteURL;
}
// Review: This should be fixed.
#pragma warning disable 688 // link demand on override
// Object::Equals
// Override the default implementation which just compares the names
public override bool Equals(Object o)
{
return (o is IContextProperty) && (o is UrlAttribute) &&
(((UrlAttribute)o).UrlValue.Equals(url));
}
public override int GetHashCode()
{
return this.url.GetHashCode();
}
#pragma warning disable
// Override ContextAttribute's implementation of IContextAttribute::IsContextOK
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.Infrastructure)]
[System.Runtime.InteropServices.ComVisible(true)]
public override bool IsContextOK(Context ctx, IConstructionCallMessage msg)
{
return false;
}
// Override ContextAttribute's impl. of IContextAttribute::GetPropForNewCtx
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.Infrastructure)]
[System.Runtime.InteropServices.ComVisible(true)]
public override void GetPropertiesForNewContext(IConstructionCallMessage ctorMsg)
{
// We are not interested in contributing any properties to the
// new context since the only purpose of this property is to force
// the creation of the context and the server object inside it at
// the specified URL.
return;
}
public String UrlValue
{
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.Infrastructure)]
get { return url; }
}
}
} // namespace
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IPEndPointCollection.cs
- XPathScanner.cs
- XmlBaseReader.cs
- DictionaryMarkupSerializer.cs
- TextParaClient.cs
- SharedStream.cs
- TextInfo.cs
- SystemResourceKey.cs
- UInt64Storage.cs
- IItemContainerGenerator.cs
- BooleanAnimationUsingKeyFrames.cs
- _Rfc2616CacheValidators.cs
- CodeSnippetTypeMember.cs
- ToolStripDropTargetManager.cs
- TreeIterators.cs
- XmlSchemaComplexContent.cs
- WebPartConnectionsConfigureVerb.cs
- MetadataItemEmitter.cs
- ResourceProperty.cs
- SqlConnectionFactory.cs
- AdapterUtil.cs
- DataStorage.cs
- DSASignatureFormatter.cs
- HandledMouseEvent.cs
- translator.cs
- Transform3D.cs
- ConstraintManager.cs
- WebScriptServiceHost.cs
- Transform3D.cs
- ServicePointManager.cs
- Buffer.cs
- PropertyTabAttribute.cs
- PeerCollaborationPermission.cs
- DataGridViewSelectedColumnCollection.cs
- MimePart.cs
- _LocalDataStore.cs
- SplashScreen.cs
- GridItem.cs
- CollectionBase.cs
- LinearKeyFrames.cs
- IOException.cs
- ToolStripItemEventArgs.cs
- EdgeModeValidation.cs
- _NegoState.cs
- StyleCollection.cs
- RouteParametersHelper.cs
- EpmTargetTree.cs
- UnsafeNativeMethods.cs
- SemanticValue.cs
- HyperLink.cs
- HttpCachePolicyElement.cs
- PersistenceTypeAttribute.cs
- SymmetricAlgorithm.cs
- VSWCFServiceContractGenerator.cs
- Rotation3D.cs
- ParserContext.cs
- DataSetSchema.cs
- TypeDescriptor.cs
- ClientUtils.cs
- SecurityContext.cs
- HtmlInputRadioButton.cs
- TextDpi.cs
- CodeParameterDeclarationExpression.cs
- LiteralControl.cs
- RelatedPropertyManager.cs
- SmiConnection.cs
- PrinterResolution.cs
- ThreadStartException.cs
- TransactionProxy.cs
- ClassGenerator.cs
- GeometryModel3D.cs
- GetPageNumberCompletedEventArgs.cs
- TimeSpanValidatorAttribute.cs
- TailCallAnalyzer.cs
- ParserStack.cs
- COAUTHIDENTITY.cs
- odbcmetadatacolumnnames.cs
- XmlAttributeCollection.cs
- IDQuery.cs
- AdornerHitTestResult.cs
- StreamResourceInfo.cs
- IdentityManager.cs
- DelegatingTypeDescriptionProvider.cs
- MobileSysDescriptionAttribute.cs
- CollectionViewGroupInternal.cs
- TypeToken.cs
- TypeDescriptor.cs
- OverrideMode.cs
- EntityDataSourceWizardForm.cs
- TextWriterTraceListener.cs
- SqlDataSourceCommandEventArgs.cs
- CodeGeneratorOptions.cs
- FlowDocument.cs
- DataSetMappper.cs
- DataSetUtil.cs
- ServiceDurableInstanceContextProvider.cs
- IMembershipProvider.cs
- CustomAttributeBuilder.cs
- DesignBindingPicker.cs
- Win32PrintDialog.cs