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
- WizardForm.cs
- WindowsIdentity.cs
- CheckoutException.cs
- ComAdminInterfaces.cs
- DataObject.cs
- HMACRIPEMD160.cs
- StreamSecurityUpgradeAcceptor.cs
- BindingSourceDesigner.cs
- EdmEntityTypeAttribute.cs
- NativeRecognizer.cs
- MemoryMappedView.cs
- HtmlContainerControl.cs
- CompilationLock.cs
- InvariantComparer.cs
- TableTextElementCollectionInternal.cs
- SoapCodeExporter.cs
- DisplayMemberTemplateSelector.cs
- XmlEntity.cs
- Base64WriteStateInfo.cs
- XmlElementCollection.cs
- StringSorter.cs
- WebPartConnectionCollection.cs
- ProcessHostConfigUtils.cs
- FillRuleValidation.cs
- InputMethodStateChangeEventArgs.cs
- ListViewGroupCollectionEditor.cs
- ExeConfigurationFileMap.cs
- ToolStripControlHost.cs
- ServiceDescriptionData.cs
- DebugController.cs
- SqlDependencyListener.cs
- ThicknessAnimation.cs
- Blend.cs
- cookieexception.cs
- RegistryExceptionHelper.cs
- BindingListCollectionView.cs
- Point3DKeyFrameCollection.cs
- CacheForPrimitiveTypes.cs
- RootNamespaceAttribute.cs
- SByteStorage.cs
- WebResponse.cs
- WindowsSecurityToken.cs
- StrokeCollection.cs
- EventManager.cs
- CatalogPartCollection.cs
- OrthographicCamera.cs
- ProjectionCamera.cs
- HttpRuntime.cs
- ComplexTypeEmitter.cs
- Figure.cs
- DirectionalLight.cs
- ExclusiveCanonicalizationTransform.cs
- TextSerializer.cs
- ItemCheckEvent.cs
- ApplicationFileParser.cs
- PathFigure.cs
- XslAstAnalyzer.cs
- SecurityDescriptor.cs
- StringToken.cs
- AppDomainShutdownMonitor.cs
- UrlMappingsSection.cs
- EntityDataSourceWizardForm.cs
- DataObjectFieldAttribute.cs
- ColumnReorderedEventArgs.cs
- ClientSettings.cs
- EntityStoreSchemaFilterEntry.cs
- FlowPanelDesigner.cs
- ModelItemCollectionImpl.cs
- Header.cs
- PartialCachingAttribute.cs
- ListView.cs
- SQLInt64Storage.cs
- isolationinterop.cs
- InstallerTypeAttribute.cs
- XamlReaderHelper.cs
- SecUtil.cs
- ProjectionPlan.cs
- XsdBuildProvider.cs
- ModelFactory.cs
- GeometryConverter.cs
- Attributes.cs
- AddInContractAttribute.cs
- SecureConversationVersion.cs
- TransformedBitmap.cs
- EncryptedKey.cs
- While.cs
- AssemblyAssociatedContentFileAttribute.cs
- DrawListViewSubItemEventArgs.cs
- Resources.Designer.cs
- DirectoryObjectSecurity.cs
- SqlVersion.cs
- TdsParser.cs
- HttpProtocolReflector.cs
- SqlResolver.cs
- OutputWindow.cs
- DefaultHttpHandler.cs
- InternalRelationshipCollection.cs
- FontSourceCollection.cs
- OleDbWrapper.cs
- PersonalizationProviderHelper.cs