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
- ListItemParagraph.cs
- Rotation3DAnimationBase.cs
- AggregateNode.cs
- BinaryMessageEncodingBindingElement.cs
- StyleModeStack.cs
- XamlDesignerSerializationManager.cs
- MetadataCache.cs
- DiscoveryClientRequestChannel.cs
- DateTimeFormatInfoScanner.cs
- XmlNodeReader.cs
- Rotation3D.cs
- PageCodeDomTreeGenerator.cs
- ToolStripAdornerWindowService.cs
- MDIClient.cs
- CodeGeneratorOptions.cs
- FaultReasonText.cs
- LinkArea.cs
- MediaElementAutomationPeer.cs
- InternalDuplexBindingElement.cs
- TemplateBaseAction.cs
- IItemContainerGenerator.cs
- StrokeRenderer.cs
- ContentFilePart.cs
- TraceAsyncResult.cs
- EntityWrapper.cs
- IItemProperties.cs
- PolicyUtility.cs
- BreakRecordTable.cs
- XamlReader.cs
- SplitContainer.cs
- PnrpPermission.cs
- TrackingMemoryStreamFactory.cs
- XamlReader.cs
- ListManagerBindingsCollection.cs
- LogicalMethodInfo.cs
- WebControlsSection.cs
- SHA384.cs
- Invariant.cs
- ClientEventManager.cs
- Matrix3D.cs
- PrintEvent.cs
- GlyphTypeface.cs
- ListViewItem.cs
- SelectionItemPatternIdentifiers.cs
- ItemContainerPattern.cs
- SchemaElementDecl.cs
- Identity.cs
- XmlSchemaAppInfo.cs
- TransformValueSerializer.cs
- SQLGuid.cs
- ScaleTransform.cs
- PersonalizationStateQuery.cs
- AsyncCallback.cs
- ContentValidator.cs
- FrameworkObject.cs
- JsonFormatMapping.cs
- MarshalDirectiveException.cs
- SiteIdentityPermission.cs
- TextViewBase.cs
- BitmapEffect.cs
- DocumentPageView.cs
- HandledMouseEvent.cs
- CookielessData.cs
- CodeGeneratorOptions.cs
- SqlServices.cs
- HtmlGenericControl.cs
- FileDataSourceCache.cs
- CssClassPropertyAttribute.cs
- ScrollPattern.cs
- UrlRoutingHandler.cs
- OrderPreservingPipeliningMergeHelper.cs
- DeflateStream.cs
- AnonymousIdentificationModule.cs
- DoubleCollectionConverter.cs
- localization.cs
- ContentOnlyMessage.cs
- ColumnCollection.cs
- SpellerHighlightLayer.cs
- EntityDataSourceState.cs
- _ListenerAsyncResult.cs
- RemoteWebConfigurationHostServer.cs
- SHA1Managed.cs
- NamedPipeDuplicateContext.cs
- WebPartConnectionsConnectVerb.cs
- DynamicObject.cs
- TextFindEngine.cs
- RemoteWebConfigurationHost.cs
- RoutedEventHandlerInfo.cs
- VirtualizingPanel.cs
- LassoHelper.cs
- XomlCompilerParameters.cs
- DataPagerField.cs
- Matrix.cs
- DataRecord.cs
- ClassHandlersStore.cs
- StylusPointCollection.cs
- GroupItem.cs
- MarkupCompilePass1.cs
- XmlException.cs
- DescendentsWalker.cs