Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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 ([....]) ** ** Purpose: Defines an attribute which can be used at the callsite to ** specify the URL at which the activation will happen. ** ** Date: [....] 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 // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** File: UrlAttribute.cs ** **Author: Tarun Anand ([....]) ** ** Purpose: Defines an attribute which can be used at the callsite to ** specify the URL at which the activation will happen. ** ** Date: [....] 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 // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TextSchema.cs
- MainMenu.cs
- MarginCollapsingState.cs
- ContentPlaceHolder.cs
- RootBrowserWindowProxy.cs
- ObjectDataSourceFilteringEventArgs.cs
- DataGridViewCheckBoxCell.cs
- SafeBitVector32.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- XmlMembersMapping.cs
- DocumentXmlWriter.cs
- SamlSecurityTokenAuthenticator.cs
- ListItemConverter.cs
- CfgParser.cs
- ServiceRouteHandler.cs
- PropertyOverridesDialog.cs
- MobileSysDescriptionAttribute.cs
- CryptoHandle.cs
- TextCharacters.cs
- ListBoxAutomationPeer.cs
- ContextMenuStrip.cs
- CaseStatementSlot.cs
- XmlAttributeAttribute.cs
- SchemaImporterExtensionElementCollection.cs
- ConfigPathUtility.cs
- CultureTable.cs
- PassportAuthenticationEventArgs.cs
- TypeGeneratedEventArgs.cs
- IdentitySection.cs
- EntityDataSourceWrapperCollection.cs
- Code.cs
- BrowserCapabilitiesFactoryBase.cs
- DefaultSettingsSection.cs
- BitmapEditor.cs
- WindowsTreeView.cs
- _OSSOCK.cs
- JumpTask.cs
- DescendantOverDescendantQuery.cs
- XmlSchema.cs
- SerializationStore.cs
- ConstantSlot.cs
- Msmq3PoisonHandler.cs
- MembershipValidatePasswordEventArgs.cs
- BatchStream.cs
- ListBox.cs
- CompilerState.cs
- WebPartUserCapability.cs
- LineMetrics.cs
- StdValidatorsAndConverters.cs
- SchemaSetCompiler.cs
- HMAC.cs
- ComEventsSink.cs
- HierarchicalDataSourceConverter.cs
- DelayedRegex.cs
- ProxyGenerationError.cs
- DataGridViewCellStateChangedEventArgs.cs
- MessageQueueEnumerator.cs
- Utility.cs
- DataColumnMapping.cs
- TextEmbeddedObject.cs
- ComponentManagerBroker.cs
- ParameterCollection.cs
- ToolStripSystemRenderer.cs
- MachineKeyValidationConverter.cs
- DiscoveryOperationContext.cs
- PackWebResponse.cs
- Grid.cs
- DockProviderWrapper.cs
- WizardStepBase.cs
- ImportCatalogPart.cs
- GeneralTransform3DTo2D.cs
- SoapDocumentServiceAttribute.cs
- CodeCatchClauseCollection.cs
- StylusPointProperty.cs
- SqlAggregateChecker.cs
- ObjectListDataBindEventArgs.cs
- DataGridViewCellStateChangedEventArgs.cs
- StringDictionary.cs
- DiscoveryInnerClientManaged11.cs
- SqlVersion.cs
- DirtyTextRange.cs
- HandlerBase.cs
- NameTable.cs
- AuthenticationModuleElement.cs
- AspCompat.cs
- UIElement3D.cs
- LocatorManager.cs
- DataTemplate.cs
- FirstQueryOperator.cs
- Compiler.cs
- MatrixCamera.cs
- HandlerFactoryCache.cs
- ProjectionNode.cs
- PublisherIdentityPermission.cs
- XdrBuilder.cs
- URIFormatException.cs
- SqlAggregateChecker.cs
- FrameworkName.cs
- Font.cs
- WebSysDisplayNameAttribute.cs