Code:
/ FX-1434 / FX-1434 / 1.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
- GatewayDefinition.cs
- LayoutEditorPart.cs
- CmsInterop.cs
- ApplicationServiceHelper.cs
- SafeThreadHandle.cs
- XamlStream.cs
- WebProxyScriptElement.cs
- PartitionerQueryOperator.cs
- RIPEMD160.cs
- SqlCommandBuilder.cs
- PixelShader.cs
- DoubleKeyFrameCollection.cs
- NavigationPropertyEmitter.cs
- ObjectDataSourceDisposingEventArgs.cs
- ToolStripSplitButton.cs
- sqlpipe.cs
- DrawingVisual.cs
- TemplateColumn.cs
- TypeGeneratedEventArgs.cs
- IncrementalReadDecoders.cs
- SynchronizedPool.cs
- OutArgument.cs
- PropertyInfoSet.cs
- SqlAggregateChecker.cs
- SmtpException.cs
- Exceptions.cs
- HtmlAnchor.cs
- CharUnicodeInfo.cs
- ResourceExpressionBuilder.cs
- CompilationUtil.cs
- MultitargetUtil.cs
- PartitionResolver.cs
- TextWriterTraceListener.cs
- LoadGrammarCompletedEventArgs.cs
- HijriCalendar.cs
- XmlCountingReader.cs
- Internal.cs
- BrowserTree.cs
- OleDbError.cs
- ClipboardProcessor.cs
- DebugHandleTracker.cs
- XmlSchemaImport.cs
- XmlUtil.cs
- DecimalConverter.cs
- RadioButtonStandardAdapter.cs
- TraceSection.cs
- RuntimeIdentifierPropertyAttribute.cs
- QuotedStringFormatReader.cs
- ConnectionStringSettings.cs
- DecoderFallback.cs
- wmiprovider.cs
- DataContract.cs
- NonceCache.cs
- TdsEnums.cs
- GridViewAutoFormat.cs
- FormatException.cs
- CompilationRelaxations.cs
- WebPartDeleteVerb.cs
- shaperfactoryquerycacheentry.cs
- EntityCommandDefinition.cs
- DataSetUtil.cs
- Exception.cs
- EdmScalarPropertyAttribute.cs
- HttpPostedFileBase.cs
- HtmlElementCollection.cs
- ToolStripItemTextRenderEventArgs.cs
- SqlUDTStorage.cs
- StrokeSerializer.cs
- ProtocolsSection.cs
- SAPIEngineTypes.cs
- InputProviderSite.cs
- DragDeltaEventArgs.cs
- EditorBrowsableAttribute.cs
- ConnectionInterfaceCollection.cs
- TerminateSequence.cs
- ListViewGroupItemCollection.cs
- WmiEventSink.cs
- TextWriterTraceListener.cs
- TickBar.cs
- OlePropertyStructs.cs
- FilterQueryOptionExpression.cs
- SrgsElementFactory.cs
- BitmapFrameDecode.cs
- CreateUserWizardAutoFormat.cs
- Block.cs
- ApplicationDirectory.cs
- MaskPropertyEditor.cs
- IncrementalHitTester.cs
- DataGridViewCheckBoxColumn.cs
- RegionData.cs
- cookiecollection.cs
- SmiEventSink_DeferedProcessing.cs
- MSG.cs
- BitHelper.cs
- AccessText.cs
- BevelBitmapEffect.cs
- TypeBrowser.xaml.cs
- itemelement.cs
- InternalBase.cs
- SystemEvents.cs