Code:
/ DotNET / DotNET / 8.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
- PageTextBox.cs
- XmlDataLoader.cs
- SelectionRangeConverter.cs
- CodeGen.cs
- TraceHandler.cs
- GCHandleCookieTable.cs
- XmlNodeList.cs
- SqlServer2KCompatibilityCheck.cs
- MessageProtectionOrder.cs
- ErrorHandlerFaultInfo.cs
- XmlDocumentSerializer.cs
- SystemBrushes.cs
- AddingNewEventArgs.cs
- WSHttpBindingBase.cs
- StreamHelper.cs
- TextContainerChangedEventArgs.cs
- SyndicationDeserializer.cs
- MenuItem.cs
- fixedPageContentExtractor.cs
- ObjectTag.cs
- BitmapEncoder.cs
- DateTimeOffsetAdapter.cs
- Claim.cs
- WebBrowserNavigatingEventHandler.cs
- InputBinding.cs
- CodePageUtils.cs
- StylusPointPropertyUnit.cs
- SchemaCollectionPreprocessor.cs
- QueryModel.cs
- BrowserCapabilitiesCompiler.cs
- RefreshPropertiesAttribute.cs
- DeferredReference.cs
- FactoryMaker.cs
- DataGridViewAdvancedBorderStyle.cs
- XmlDataProvider.cs
- DynamicPropertyHolder.cs
- PrivateFontCollection.cs
- BinaryObjectWriter.cs
- CollectionViewGroupInternal.cs
- Label.cs
- WebServiceReceive.cs
- UnconditionalPolicy.cs
- DSASignatureFormatter.cs
- KerberosRequestorSecurityToken.cs
- FrameworkObject.cs
- CompiledWorkflowDefinitionContext.cs
- XmlCompatibilityReader.cs
- TypeReference.cs
- VariableDesigner.xaml.cs
- D3DImage.cs
- CodeLinePragma.cs
- AssemblyBuilder.cs
- ApplicationSettingsBase.cs
- EntitySet.cs
- SoapHttpTransportImporter.cs
- CommandValueSerializer.cs
- PrintDialog.cs
- CalendarDataBindingHandler.cs
- DirectoryGroupQuery.cs
- PersonalizationState.cs
- DependencyPropertyHelper.cs
- InkCanvasFeedbackAdorner.cs
- TextEditorCopyPaste.cs
- ClassDataContract.cs
- CodeCommentStatement.cs
- ValidatorCompatibilityHelper.cs
- _ConnectOverlappedAsyncResult.cs
- XmlSchemaImporter.cs
- BehaviorEditorPart.cs
- AudioDeviceOut.cs
- Frame.cs
- ParenthesizePropertyNameAttribute.cs
- ObjectReaderCompiler.cs
- Transform.cs
- ObjectStateFormatter.cs
- DrawingGroup.cs
- ColorMatrix.cs
- WebPartVerbCollection.cs
- COAUTHINFO.cs
- ControlIdConverter.cs
- DBBindings.cs
- CookieProtection.cs
- MappingMetadataHelper.cs
- AlphaSortedEnumConverter.cs
- ShimAsPublicXamlType.cs
- ApplicationSecurityInfo.cs
- ISO2022Encoding.cs
- Documentation.cs
- SystemException.cs
- ColorConverter.cs
- TextTreePropertyUndoUnit.cs
- TextCompositionEventArgs.cs
- DataListItemCollection.cs
- DelegatingHeader.cs
- RTLAwareMessageBox.cs
- EntityViewGenerationAttribute.cs
- JoinSymbol.cs
- AutomationFocusChangedEventArgs.cs
- HorizontalAlignConverter.cs
- SymmetricSecurityProtocolFactory.cs