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
- _Rfc2616CacheValidators.cs
- XmlSchemaRedefine.cs
- ResourcePart.cs
- HttpTransportElement.cs
- MsmqInputChannelListener.cs
- ListSortDescription.cs
- StartFileNameEditor.cs
- ShaderRenderModeValidation.cs
- DecimalConstantAttribute.cs
- DesignerDataTableBase.cs
- OdbcPermission.cs
- HtmlControlPersistable.cs
- DataGridLength.cs
- ProcessThread.cs
- HtmlInputReset.cs
- SafeCloseHandleCritical.cs
- HtmlProps.cs
- DataProviderNameConverter.cs
- SecurityAttributeGenerationHelper.cs
- Odbc32.cs
- SimpleType.cs
- SpeechSeg.cs
- InitiatorServiceModelSecurityTokenRequirement.cs
- MembershipUser.cs
- SecurityException.cs
- BitmapEffectGeneralTransform.cs
- OdbcConnectionOpen.cs
- SafeFileMapViewHandle.cs
- GroupBoxRenderer.cs
- SafeLocalMemHandle.cs
- AnnotationResourceCollection.cs
- TextClipboardData.cs
- CodeVariableDeclarationStatement.cs
- DynamicPhysicalDiscoSearcher.cs
- ProxyHelper.cs
- XmlSchemaComplexContent.cs
- HandleInitializationContext.cs
- CompositeDataBoundControl.cs
- CellPartitioner.cs
- sqlcontext.cs
- DateTimeFormat.cs
- Point.cs
- SQLConvert.cs
- DefaultPrintController.cs
- ExceptionHandlersDesigner.cs
- Merger.cs
- InvalidCastException.cs
- AttributeCallbackBuilder.cs
- QilVisitor.cs
- sapiproxy.cs
- EntityTypeEmitter.cs
- TransactedReceiveData.cs
- EntityParameterCollection.cs
- StatusBarPanel.cs
- AttachedAnnotationChangedEventArgs.cs
- WindowsRegion.cs
- Int32Converter.cs
- CompositeFontParser.cs
- ReadOnlyHierarchicalDataSourceView.cs
- Rotation3D.cs
- StringConcat.cs
- NativeMethodsOther.cs
- ImmutableObjectAttribute.cs
- HtmlInputFile.cs
- StateItem.cs
- ClipboardProcessor.cs
- SetStateEventArgs.cs
- CodeCompileUnit.cs
- EmptyImpersonationContext.cs
- MarkupExtensionParser.cs
- PagerSettings.cs
- Win32PrintDialog.cs
- TextBounds.cs
- RedirectionProxy.cs
- HuffmanTree.cs
- Font.cs
- DataTemplateSelector.cs
- SQLBinary.cs
- EditorResources.cs
- WebBrowserContainer.cs
- MatrixCamera.cs
- ListSurrogate.cs
- Shared.cs
- XmlnsDictionary.cs
- ApplicationSecurityManager.cs
- SiteMapDataSource.cs
- ChangeProcessor.cs
- ManipulationLogic.cs
- OperationInfoBase.cs
- PerfService.cs
- ToolBarTray.cs
- SimpleMailWebEventProvider.cs
- RandomDelayQueuedSendsAsyncResult.cs
- ConfigXmlCDataSection.cs
- Sql8ExpressionRewriter.cs
- HtmlElementCollection.cs
- ObjectTag.cs
- TransactionWaitAsyncResult.cs
- PageEventArgs.cs
- JapaneseLunisolarCalendar.cs