Code:
/ DotNET / DotNET / 8.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
- IfJoinedCondition.cs
- CachedPathData.cs
- CodeDOMUtility.cs
- UnaryNode.cs
- SecurityTokenAuthenticator.cs
- CopyOnWriteList.cs
- WeakReferenceEnumerator.cs
- SafeFindHandle.cs
- SQLMembershipProvider.cs
- HttpModuleAction.cs
- JsonEncodingStreamWrapper.cs
- HelpProvider.cs
- SafeHandles.cs
- ValueProviderWrapper.cs
- Soap12FormatExtensions.cs
- ImageDesigner.cs
- EntityCollectionChangedParams.cs
- MonthCalendar.cs
- TrackingDataItemValue.cs
- WebPartConnectionsEventArgs.cs
- CapiSymmetricAlgorithm.cs
- SqlConnectionString.cs
- IssuedTokensHeader.cs
- GridEntry.cs
- EmptyImpersonationContext.cs
- SqlProvider.cs
- TdsRecordBufferSetter.cs
- UpdateRecord.cs
- CheckedListBox.cs
- TriState.cs
- SqlCacheDependencyDatabaseCollection.cs
- DesignerExtenders.cs
- FaultContractInfo.cs
- IBuiltInEvidence.cs
- XmlSchemaType.cs
- SqlGenerator.cs
- Bits.cs
- SmtpNtlmAuthenticationModule.cs
- HMACSHA256.cs
- XhtmlBasicPanelAdapter.cs
- PluralizationService.cs
- TextDecorationCollection.cs
- CopyNodeSetAction.cs
- WsdlImporterElementCollection.cs
- BooleanSwitch.cs
- ListItemConverter.cs
- GraphicsState.cs
- Decoder.cs
- TemplateBamlTreeBuilder.cs
- WebInvokeAttribute.cs
- DispatcherExceptionEventArgs.cs
- FrameworkTextComposition.cs
- MetadataSerializer.cs
- OverflowException.cs
- CqlLexer.cs
- UIElementHelper.cs
- ContentPlaceHolderDesigner.cs
- SignatureResourceHelper.cs
- COSERVERINFO.cs
- DispatcherExceptionEventArgs.cs
- HttpConfigurationSystem.cs
- RemoteWebConfigurationHostServer.cs
- ResponseBodyWriter.cs
- SqlDataSourceConfigureFilterForm.cs
- UnsafeNativeMethods.cs
- WinCategoryAttribute.cs
- ObjectContextServiceProvider.cs
- SoapSchemaExporter.cs
- FindCriteria.cs
- DataMemberFieldConverter.cs
- MediaElementAutomationPeer.cs
- CodeGen.cs
- ItemAutomationPeer.cs
- GridErrorDlg.cs
- DataObjectCopyingEventArgs.cs
- ButtonBase.cs
- ErrorHandler.cs
- QueryParameter.cs
- VideoDrawing.cs
- WebPartAddingEventArgs.cs
- Reference.cs
- ChannelTerminatedException.cs
- VectorCollectionConverter.cs
- CompilerGeneratedAttribute.cs
- Clause.cs
- CurrencyWrapper.cs
- PenThread.cs
- DataListGeneralPage.cs
- ListBase.cs
- EventLogEntry.cs
- ToolStripMenuItem.cs
- DuplicateWaitObjectException.cs
- StreamingContext.cs
- FieldToken.cs
- XamlTypeMapper.cs
- SQLUtility.cs
- NamedPipeConnectionPoolSettings.cs
- InlineCollection.cs
- MessageDescriptionCollection.cs
- EntityDataSourceColumn.cs