Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- Transform3D.cs
- TriggerActionCollection.cs
- TransformGroup.cs
- XamlPointCollectionSerializer.cs
- SQLUtility.cs
- ItemChangedEventArgs.cs
- StagingAreaInputItem.cs
- Underline.cs
- ConstructorExpr.cs
- EventHandlingScope.cs
- SafeTokenHandle.cs
- UndoManager.cs
- DataDocumentXPathNavigator.cs
- ProfileService.cs
- XPathNodeHelper.cs
- _Rfc2616CacheValidators.cs
- Int32AnimationBase.cs
- FunctionCommandText.cs
- WebPartConnectionsCancelVerb.cs
- AsyncStreamReader.cs
- ButtonField.cs
- GridViewAutomationPeer.cs
- DesignerImageAdapter.cs
- StructuredCompositeActivityDesigner.cs
- XmlnsCache.cs
- WebPartConnectionsCancelEventArgs.cs
- ComponentEvent.cs
- HtmlTitle.cs
- RadioButtonRenderer.cs
- DiscoveryMessageSequence11.cs
- RegexReplacement.cs
- Opcode.cs
- ExtentKey.cs
- Keywords.cs
- ToolStripControlHost.cs
- TextParaClient.cs
- FigureHelper.cs
- BitmapCodecInfo.cs
- ContainerParagraph.cs
- FunctionQuery.cs
- QilName.cs
- PrivateFontCollection.cs
- TextDecorationLocationValidation.cs
- DigestTraceRecordHelper.cs
- QilGenerator.cs
- PaperSize.cs
- RotateTransform.cs
- WebBrowserHelper.cs
- SchemaRegistration.cs
- MasterPageParser.cs
- DataGridParentRows.cs
- DeleteWorkflowOwnerCommand.cs
- UnauthorizedAccessException.cs
- ColorBlend.cs
- SwitchElementsCollection.cs
- ImageButton.cs
- FormsAuthenticationModule.cs
- DropTarget.cs
- ThrowHelper.cs
- QueryConverter.cs
- SimpleBitVector32.cs
- PartialList.cs
- ArrayWithOffset.cs
- CompiledQueryCacheKey.cs
- FirstQueryOperator.cs
- WebConfigurationManager.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- SqlFactory.cs
- HiddenFieldPageStatePersister.cs
- WindowAutomationPeer.cs
- CreateParams.cs
- ResXFileRef.cs
- MediaTimeline.cs
- UriParserTemplates.cs
- ToggleButtonAutomationPeer.cs
- JavaScriptString.cs
- SymLanguageType.cs
- SqlNamer.cs
- AddInController.cs
- GroupQuery.cs
- LocalizableResourceBuilder.cs
- TemplateControlParser.cs
- MessageLogTraceRecord.cs
- Util.cs
- TextSelectionHighlightLayer.cs
- MdImport.cs
- RegistryPermission.cs
- PathNode.cs
- AlternationConverter.cs
- __Error.cs
- WorkflowElementDialog.cs
- Double.cs
- DesignerLinkAdapter.cs
- TlsSspiNegotiation.cs
- DesignerActionUIStateChangeEventArgs.cs
- DbParameterCollectionHelper.cs
- SectionVisual.cs
- XmlWellformedWriter.cs
- VirtualizingStackPanel.cs
- CustomDictionarySources.cs