Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / UI / WebParts / ConnectionConsumerAttribute.cs / 1 / ConnectionConsumerAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls.WebParts { using System; using System.ComponentModel; using System.Reflection; using System.Security.Permissions; [AttributeUsage(AttributeTargets.Method)] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] public class ConnectionConsumerAttribute : Attribute { private string _displayName; private string _id; private Type _connectionPointType; private bool _allowsMultipleConnections; public ConnectionConsumerAttribute(string displayName) { if (String.IsNullOrEmpty(displayName)) { throw new ArgumentNullException("displayName"); } _displayName = displayName; _allowsMultipleConnections = false; } public ConnectionConsumerAttribute(string displayName, string id) : this(displayName) { if (String.IsNullOrEmpty(id)) { throw new ArgumentNullException("id"); } _id = id; } public ConnectionConsumerAttribute(string displayName, Type connectionPointType) : this(displayName) { if (connectionPointType == null) { throw new ArgumentNullException("connectionPointType"); } _connectionPointType = connectionPointType; } public ConnectionConsumerAttribute(string displayName, string id, Type connectionPointType) : this(displayName, connectionPointType) { if (String.IsNullOrEmpty(id)) { throw new ArgumentNullException("id"); } _id = id; } public bool AllowsMultipleConnections { get { return _allowsMultipleConnections; } set { _allowsMultipleConnections = value; } } public string ID { get { return (_id != null) ? _id : String.Empty; } } public virtual string DisplayName { get { return DisplayNameValue; } } protected string DisplayNameValue { get { return _displayName; } set { _displayName = value; } } public Type ConnectionPointType { get { if (WebPartUtil.IsConnectionPointTypeValid(_connectionPointType, /*isConsumer*/ true)) { return _connectionPointType; } else { throw new InvalidOperationException(SR.GetString( SR.ConnectionConsumerAttribute_InvalidConnectionPointType, _connectionPointType.Name)); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls.WebParts { using System; using System.ComponentModel; using System.Reflection; using System.Security.Permissions; [AttributeUsage(AttributeTargets.Method)] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] public class ConnectionConsumerAttribute : Attribute { private string _displayName; private string _id; private Type _connectionPointType; private bool _allowsMultipleConnections; public ConnectionConsumerAttribute(string displayName) { if (String.IsNullOrEmpty(displayName)) { throw new ArgumentNullException("displayName"); } _displayName = displayName; _allowsMultipleConnections = false; } public ConnectionConsumerAttribute(string displayName, string id) : this(displayName) { if (String.IsNullOrEmpty(id)) { throw new ArgumentNullException("id"); } _id = id; } public ConnectionConsumerAttribute(string displayName, Type connectionPointType) : this(displayName) { if (connectionPointType == null) { throw new ArgumentNullException("connectionPointType"); } _connectionPointType = connectionPointType; } public ConnectionConsumerAttribute(string displayName, string id, Type connectionPointType) : this(displayName, connectionPointType) { if (String.IsNullOrEmpty(id)) { throw new ArgumentNullException("id"); } _id = id; } public bool AllowsMultipleConnections { get { return _allowsMultipleConnections; } set { _allowsMultipleConnections = value; } } public string ID { get { return (_id != null) ? _id : String.Empty; } } public virtual string DisplayName { get { return DisplayNameValue; } } protected string DisplayNameValue { get { return _displayName; } set { _displayName = value; } } public Type ConnectionPointType { get { if (WebPartUtil.IsConnectionPointTypeValid(_connectionPointType, /*isConsumer*/ true)) { return _connectionPointType; } else { throw new InvalidOperationException(SR.GetString( SR.ConnectionConsumerAttribute_InvalidConnectionPointType, _connectionPointType.Name)); } } } } } // 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
- SecureUICommand.cs
- TrackPointCollection.cs
- ImageList.cs
- SystemIPGlobalProperties.cs
- TemplateColumn.cs
- UIElementAutomationPeer.cs
- ToolStripMenuItemDesigner.cs
- Mouse.cs
- ServiceModelEnumValidator.cs
- TextEffect.cs
- ContextMarshalException.cs
- IntSecurity.cs
- SingleSelectRootGridEntry.cs
- PartialTrustVisibleAssembliesSection.cs
- CollectionChangedEventManager.cs
- WindowsSlider.cs
- ViewCellSlot.cs
- Columns.cs
- RunClient.cs
- HttpModuleAction.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- DisplayInformation.cs
- DBAsyncResult.cs
- TypeExtensions.cs
- LineInfo.cs
- MobileCapabilities.cs
- SvcMapFileSerializer.cs
- SspiSecurityTokenParameters.cs
- HtmlToClrEventProxy.cs
- SchemaElementDecl.cs
- DataGridViewHitTestInfo.cs
- StrokeCollectionConverter.cs
- OrderedDictionary.cs
- LicenseContext.cs
- SubclassTypeValidatorAttribute.cs
- CngAlgorithmGroup.cs
- UnsafeNativeMethods.cs
- ListBindableAttribute.cs
- StatusBar.cs
- BinaryParser.cs
- WmlImageAdapter.cs
- HtmlMeta.cs
- CompilationLock.cs
- safesecurityhelperavalon.cs
- CapabilitiesPattern.cs
- BulletDecorator.cs
- Registry.cs
- OdbcConnectionPoolProviderInfo.cs
- ContentElementAutomationPeer.cs
- CollectionEditor.cs
- TextParaLineResult.cs
- FixedSOMLineCollection.cs
- XmlBindingWorker.cs
- DesignerOptionService.cs
- SimpleType.cs
- CreateParams.cs
- IdentitySection.cs
- EventSinkActivityDesigner.cs
- CodeGroup.cs
- ReaderWriterLock.cs
- RunWorkerCompletedEventArgs.cs
- ContextProperty.cs
- EntitySqlQueryBuilder.cs
- IdentityManager.cs
- ReadContentAsBinaryHelper.cs
- DataServiceProviderWrapper.cs
- VectorCollection.cs
- StringBuilder.cs
- TypeSource.cs
- ShapingEngine.cs
- ILGen.cs
- EntityDataSourceStatementEditor.cs
- AspNetSynchronizationContext.cs
- XmlSchemaAppInfo.cs
- DataGridViewCellCollection.cs
- LoadItemsEventArgs.cs
- UserControlBuildProvider.cs
- UnknownBitmapEncoder.cs
- CodeChecksumPragma.cs
- MissingMethodException.cs
- ProcessThread.cs
- DuplicateWaitObjectException.cs
- ProfileGroupSettings.cs
- ServiceContractGenerator.cs
- HttpWebRequestElement.cs
- ArraySortHelper.cs
- NetworkCredential.cs
- RegionIterator.cs
- SizeConverter.cs
- DbConnectionOptions.cs
- TextBoxBase.cs
- ResourceReferenceKeyNotFoundException.cs
- MergeFailedEvent.cs
- HitTestDrawingContextWalker.cs
- PointLight.cs
- WeakEventManager.cs
- FileFormatException.cs
- FlowLayout.cs
- AuthorizationRuleCollection.cs
- __ConsoleStream.cs