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
- XPathDocumentBuilder.cs
- LineProperties.cs
- ProjectionCamera.cs
- XsltLibrary.cs
- SettingsBase.cs
- IfJoinedCondition.cs
- DataGridViewDataErrorEventArgs.cs
- DataGridRow.cs
- HttpDebugHandler.cs
- CodeGenHelper.cs
- translator.cs
- XhtmlMobileTextWriter.cs
- NCryptSafeHandles.cs
- EncryptedPackage.cs
- VectorConverter.cs
- SqlPersonalizationProvider.cs
- OrderablePartitioner.cs
- ActionMismatchAddressingException.cs
- DataGridItem.cs
- M3DUtil.cs
- TableLayoutStyleCollection.cs
- METAHEADER.cs
- Utils.cs
- ListBindingConverter.cs
- NamespaceDecl.cs
- ReverseInheritProperty.cs
- NavigationProperty.cs
- TabletCollection.cs
- SafeSystemMetrics.cs
- NavigationProperty.cs
- LiteralControl.cs
- TimeZone.cs
- _UriSyntax.cs
- QueryContinueDragEvent.cs
- SmiContext.cs
- DialogWindow.cs
- BufferBuilder.cs
- SQLDateTimeStorage.cs
- UserControlCodeDomTreeGenerator.cs
- TaiwanLunisolarCalendar.cs
- TextModifier.cs
- DocumentStream.cs
- KeySplineConverter.cs
- SinglePhaseEnlistment.cs
- MultiDataTrigger.cs
- SoapCodeExporter.cs
- InvalidPrinterException.cs
- FlowPanelDesigner.cs
- PropertyFilter.cs
- SoapFormatterSinks.cs
- GeneralTransform3DGroup.cs
- ProviderConnectionPoint.cs
- TextElementAutomationPeer.cs
- EventLogPermissionAttribute.cs
- DataFieldConverter.cs
- XmlSchemas.cs
- SpecialFolderEnumConverter.cs
- BamlCollectionHolder.cs
- HtmlInputFile.cs
- UnhandledExceptionEventArgs.cs
- Solver.cs
- PropertyMapper.cs
- TextParentUndoUnit.cs
- PartManifestEntry.cs
- SelectionUIHandler.cs
- CharEnumerator.cs
- IProvider.cs
- HitTestWithPointDrawingContextWalker.cs
- TripleDESCryptoServiceProvider.cs
- BamlLocalizer.cs
- ADRoleFactory.cs
- ControlAdapter.cs
- EntityContainer.cs
- SafeArrayTypeMismatchException.cs
- HttpApplication.cs
- SingleAnimationUsingKeyFrames.cs
- XmlSigningNodeWriter.cs
- NTAccount.cs
- XmlSchemaNotation.cs
- WebPartManager.cs
- CacheVirtualItemsEvent.cs
- CorrelationRequestContext.cs
- Root.cs
- IPipelineRuntime.cs
- PassportIdentity.cs
- HtmlForm.cs
- WebPartZone.cs
- VideoDrawing.cs
- UpDownEvent.cs
- ToolStripDropDown.cs
- ControlValuePropertyAttribute.cs
- ISAPIRuntime.cs
- Operators.cs
- ContextMenu.cs
- RotateTransform3D.cs
- DeferredTextReference.cs
- PrintPreviewDialog.cs
- SQLByteStorage.cs
- CodePrimitiveExpression.cs
- TypeInfo.cs