Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- StrongBox.cs
- NodeInfo.cs
- StdValidatorsAndConverters.cs
- StrongTypingException.cs
- EntityAdapter.cs
- Subset.cs
- MeshGeometry3D.cs
- EntityDataSourceWizardForm.cs
- ProcessHostFactoryHelper.cs
- OleDbDataReader.cs
- BooleanStorage.cs
- LogSwitch.cs
- ProcessDesigner.cs
- Tool.cs
- ParallelTimeline.cs
- ServiceDescriptionData.cs
- GenerateTemporaryTargetAssembly.cs
- XmlReflectionImporter.cs
- CompositeControl.cs
- Conditional.cs
- DelayLoadType.cs
- diagnosticsswitches.cs
- WorkflowDesignerColors.cs
- ValidatorUtils.cs
- TransformValueSerializer.cs
- OleDbWrapper.cs
- NullableIntMinMaxAggregationOperator.cs
- HtmlToClrEventProxy.cs
- UserPreference.cs
- CopyAttributesAction.cs
- GradientStop.cs
- AnnouncementInnerClient11.cs
- MasterPage.cs
- DataQuery.cs
- MetafileEditor.cs
- WorkflowCommandExtensionItem.cs
- AssociatedControlConverter.cs
- AnimationClockResource.cs
- ClientRuntimeConfig.cs
- LogFlushAsyncResult.cs
- SqlDataSourceView.cs
- CodeConditionStatement.cs
- HitTestParameters3D.cs
- DBDataPermission.cs
- UnmanagedMemoryStreamWrapper.cs
- AppDomainProtocolHandler.cs
- TextSelectionProcessor.cs
- StructuredTypeEmitter.cs
- MemberBinding.cs
- HttpCookie.cs
- SortedList.cs
- HttpCachePolicy.cs
- WinFormsSecurity.cs
- ILGenerator.cs
- WindowsFont.cs
- StructuredType.cs
- mda.cs
- HttpCapabilitiesEvaluator.cs
- ProfessionalColorTable.cs
- ScrollBar.cs
- ColorConvertedBitmapExtension.cs
- infer.cs
- OneOfScalarConst.cs
- CryptoProvider.cs
- PanelStyle.cs
- ComboBoxAutomationPeer.cs
- SEHException.cs
- SelectingProviderEventArgs.cs
- FieldNameLookup.cs
- FormViewDeletedEventArgs.cs
- GridLength.cs
- CheckBox.cs
- CatalogPartChrome.cs
- UserControlBuildProvider.cs
- _IPv6Address.cs
- ThreadStaticAttribute.cs
- HttpCookiesSection.cs
- PersonalizationState.cs
- ExtensionElement.cs
- MimeObjectFactory.cs
- OdbcHandle.cs
- TokenBasedSet.cs
- SubMenuStyle.cs
- RtfToken.cs
- AutoScrollExpandMessageFilter.cs
- MetadataUtil.cs
- XmlStreamStore.cs
- DesignerAttribute.cs
- RegistryKey.cs
- ProjectedSlot.cs
- Slider.cs
- EntityReference.cs
- GPStream.cs
- IncrementalCompileAnalyzer.cs
- PropertyFilterAttribute.cs
- ScriptIgnoreAttribute.cs
- dataprotectionpermission.cs
- IndicFontClient.cs
- HtmlButton.cs
- RoleService.cs