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
- PresentationSource.cs
- TextStore.cs
- ExtentJoinTreeNode.cs
- QueryContinueDragEvent.cs
- MemoryStream.cs
- PerspectiveCamera.cs
- ComplexType.cs
- AutomationElementCollection.cs
- ObjectDataSourceMethodEditor.cs
- XPathArrayIterator.cs
- VisualStyleRenderer.cs
- MeasureData.cs
- Light.cs
- GradientStop.cs
- DefaultMergeHelper.cs
- DetailsViewInsertedEventArgs.cs
- ClosableStream.cs
- ComponentCache.cs
- AspProxy.cs
- BackStopAuthenticationModule.cs
- LayoutEditorPart.cs
- SessionStateSection.cs
- ImageCodecInfo.cs
- MediaContext.cs
- TypeNameConverter.cs
- UnauthorizedWebPart.cs
- Input.cs
- DataServiceKeyAttribute.cs
- BindingGroup.cs
- Rfc2898DeriveBytes.cs
- TableLayoutSettingsTypeConverter.cs
- EventLogPermissionAttribute.cs
- Scene3D.cs
- ResourceDictionaryCollection.cs
- Dictionary.cs
- HexParser.cs
- VectorAnimationUsingKeyFrames.cs
- RangeValidator.cs
- ContextStack.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- TrueReadOnlyCollection.cs
- DataServiceHostFactory.cs
- HostingEnvironmentException.cs
- XPathExpr.cs
- PropertyChange.cs
- StyleSheetComponentEditor.cs
- XmlQuerySequence.cs
- HyperLink.cs
- CodeDomSerializerException.cs
- WebPartCancelEventArgs.cs
- MdImport.cs
- QueryGeneratorBase.cs
- DetailsViewDeleteEventArgs.cs
- FilteredDataSetHelper.cs
- ObjectDisposedException.cs
- ISAPIApplicationHost.cs
- CodeMemberProperty.cs
- AssemblyResourceLoader.cs
- DropAnimation.xaml.cs
- RegionInfo.cs
- MouseWheelEventArgs.cs
- Literal.cs
- DecimalStorage.cs
- ExecutedRoutedEventArgs.cs
- DefaultSerializationProviderAttribute.cs
- DynamicEntity.cs
- Propagator.JoinPropagator.cs
- BuildProvidersCompiler.cs
- XmlAutoDetectWriter.cs
- ObfuscationAttribute.cs
- TransformerInfo.cs
- MimeTextImporter.cs
- CodeGenerator.cs
- CodeTypeDeclarationCollection.cs
- DrawingServices.cs
- TraversalRequest.cs
- SchemaElementLookUpTable.cs
- RequestCacheValidator.cs
- AuthenticationService.cs
- ObjectListCommandCollection.cs
- XsltQilFactory.cs
- DataGridCaption.cs
- EntityContainerEmitter.cs
- TraceContext.cs
- PageVisual.cs
- PropertyItem.cs
- HttpSocketManager.cs
- WebPartsPersonalizationAuthorization.cs
- StreamGeometryContext.cs
- ContentValidator.cs
- Pair.cs
- Tuple.cs
- PropertyChangingEventArgs.cs
- SynchronizedInputPattern.cs
- LicFileLicenseProvider.cs
- DbException.cs
- Win32.cs
- Pick.cs
- SecurityCriticalDataForSet.cs
- CachedFontFamily.cs