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
- MSHTMLHostUtil.cs
- QuerySelectOp.cs
- CommandID.cs
- BamlReader.cs
- SqlDataSource.cs
- DateTimeFormat.cs
- WindowsTab.cs
- SchemaNotation.cs
- BooleanToVisibilityConverter.cs
- PageBuildProvider.cs
- DispatcherProcessingDisabled.cs
- Set.cs
- XhtmlStyleClass.cs
- ZipIOExtraField.cs
- Logging.cs
- HTTP_SERVICE_CONFIG_URLACL_PARAM.cs
- ProcessModelInfo.cs
- XmlElementList.cs
- IdentifierService.cs
- KeyValuePair.cs
- ToolStripItemTextRenderEventArgs.cs
- StylusOverProperty.cs
- Solver.cs
- ChameleonKey.cs
- AbsoluteQuery.cs
- CellLabel.cs
- DataSetMappper.cs
- EventLogPermission.cs
- Compiler.cs
- DataIdProcessor.cs
- ThrowHelper.cs
- GridViewRowCollection.cs
- XmlSchemaRedefine.cs
- XmlWriterTraceListener.cs
- OleDbError.cs
- WebRequestModuleElement.cs
- Vertex.cs
- ObjectSpanRewriter.cs
- LinqDataSourceView.cs
- XmlDocumentFragment.cs
- DataPagerFieldItem.cs
- CodeDomConfigurationHandler.cs
- HttpAsyncResult.cs
- MemberDescriptor.cs
- ListViewDeletedEventArgs.cs
- SqlDataSource.cs
- ObjectQueryState.cs
- ExpressionVisitor.cs
- UnsafeNativeMethodsCLR.cs
- TextBoxBase.cs
- XmlBufferReader.cs
- Pen.cs
- OutputCacheProfileCollection.cs
- HostedTransportConfigurationManager.cs
- DefaultTypeArgumentAttribute.cs
- FormConverter.cs
- CollectionBase.cs
- ListControlConvertEventArgs.cs
- MatrixStack.cs
- HttpClientProtocol.cs
- MetadataCache.cs
- DBPropSet.cs
- SafeProcessHandle.cs
- GridViewDeletedEventArgs.cs
- WebPartConnectionCollection.cs
- EntryPointNotFoundException.cs
- ConstantProjectedSlot.cs
- OleDbDataAdapter.cs
- XmlSchemaAnyAttribute.cs
- IApplicationTrustManager.cs
- UnionCodeGroup.cs
- SqlDependency.cs
- TrackingRecordPreFilter.cs
- XsltContext.cs
- TextRenderer.cs
- XmlSchemaSubstitutionGroup.cs
- SiblingIterators.cs
- Column.cs
- PersistenceTask.cs
- LinqDataSourceInsertEventArgs.cs
- TableSectionStyle.cs
- BitmapCodecInfo.cs
- RowParagraph.cs
- CornerRadius.cs
- XmlRootAttribute.cs
- FixedPageStructure.cs
- MetadataPropertyAttribute.cs
- BindingContext.cs
- ErrorHandler.cs
- XmlSchemaObjectCollection.cs
- DescendantBaseQuery.cs
- SoapClientProtocol.cs
- ItemsPresenter.cs
- TextShapeableCharacters.cs
- NullToBooleanConverter.cs
- IsolatedStorageException.cs
- Rss20ItemFormatter.cs
- LogPolicy.cs
- InkCollectionBehavior.cs
- InputScopeAttribute.cs