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
- DataServices.cs
- FunctionNode.cs
- ExpandedWrapper.cs
- CodeBinaryOperatorExpression.cs
- ServerValidateEventArgs.cs
- ContractAdapter.cs
- ColorConvertedBitmap.cs
- NavigationProperty.cs
- FileVersionInfo.cs
- Connector.cs
- ModelUtilities.cs
- VirtualDirectoryMapping.cs
- InputChannel.cs
- RecognizerBase.cs
- ColorIndependentAnimationStorage.cs
- ImageFormatConverter.cs
- RegexWriter.cs
- ContentAlignmentEditor.cs
- AtomServiceDocumentSerializer.cs
- PointLight.cs
- ISAPIApplicationHost.cs
- SQLDouble.cs
- DependencyPropertyKind.cs
- Int16AnimationUsingKeyFrames.cs
- CheckBoxStandardAdapter.cs
- ConstraintCollection.cs
- ParenthesizePropertyNameAttribute.cs
- WebServiceFaultDesigner.cs
- HttpAsyncResult.cs
- _NegoStream.cs
- ScriptMethodAttribute.cs
- DataGridLinkButton.cs
- Int64Converter.cs
- SynchronizedDispatch.cs
- DisableDpiAwarenessAttribute.cs
- XmlSchemaSequence.cs
- ScriptResourceInfo.cs
- X509Utils.cs
- TextTrailingCharacterEllipsis.cs
- CapabilitiesPattern.cs
- COM2AboutBoxPropertyDescriptor.cs
- EventMappingSettings.cs
- BinaryFormatter.cs
- Effect.cs
- ShapingEngine.cs
- MessageDecoder.cs
- RegularExpressionValidator.cs
- NumericPagerField.cs
- SqlWebEventProvider.cs
- ITextView.cs
- DrawListViewItemEventArgs.cs
- ConditionalAttribute.cs
- CombinedGeometry.cs
- Console.cs
- StringAnimationUsingKeyFrames.cs
- RectangleConverter.cs
- COM2ICategorizePropertiesHandler.cs
- DashStyle.cs
- HelpInfo.cs
- WeakReferenceKey.cs
- ReflectionTypeLoadException.cs
- MessageDecoder.cs
- UnicodeEncoding.cs
- PointLightBase.cs
- WebPartVerbCollection.cs
- AncestorChangedEventArgs.cs
- KoreanCalendar.cs
- RootDesignerSerializerAttribute.cs
- DependentList.cs
- ProfileProvider.cs
- XmlSchemaSimpleTypeUnion.cs
- SrgsGrammarCompiler.cs
- PrivilegeNotHeldException.cs
- SessionSymmetricTransportSecurityProtocolFactory.cs
- VectorCollection.cs
- elementinformation.cs
- StylusEventArgs.cs
- SqlConnectionManager.cs
- RequestQueryProcessor.cs
- DataGridBeginningEditEventArgs.cs
- JsonSerializer.cs
- EntityModelBuildProvider.cs
- DataSourceXmlAttributeAttribute.cs
- MainMenu.cs
- SchemaCollectionCompiler.cs
- InvokeWebService.cs
- ReturnType.cs
- BulletDecorator.cs
- OleDbParameterCollection.cs
- ScriptDescriptor.cs
- XPathSelectionIterator.cs
- FormsAuthenticationConfiguration.cs
- DetailsViewRow.cs
- TextRangeBase.cs
- UTF32Encoding.cs
- ObjectDataSourceEventArgs.cs
- PerformanceCounterPermissionAttribute.cs
- SerializationInfo.cs
- XamlReaderConstants.cs
- RepeaterItemEventArgs.cs