Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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)); } } } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SchemaTableOptionalColumn.cs
- DashStyle.cs
- FixedSOMPageElement.cs
- CompiledQueryCacheKey.cs
- VisualBasicDesignerHelper.cs
- ButtonChrome.cs
- DigestTraceRecordHelper.cs
- MethodRental.cs
- PrintingPermissionAttribute.cs
- WebPartActionVerb.cs
- SecurityContext.cs
- PrePrepareMethodAttribute.cs
- CodeMemberField.cs
- ExitEventArgs.cs
- MeshGeometry3D.cs
- PropertyCollection.cs
- RequestSecurityTokenResponse.cs
- ColorPalette.cs
- DataSysAttribute.cs
- XmlSchemaInclude.cs
- TextOnlyOutput.cs
- ArrayEditor.cs
- ConfigurationElementProperty.cs
- EnvelopedPkcs7.cs
- FilterFactory.cs
- TextReader.cs
- ProcessThread.cs
- XmlSchemaComplexContentExtension.cs
- DataViewSetting.cs
- HyperlinkAutomationPeer.cs
- NetCodeGroup.cs
- IPAddressCollection.cs
- SQLDecimal.cs
- SchemaElementLookUpTable.cs
- xml.cs
- RequestStatusBarUpdateEventArgs.cs
- XPathNode.cs
- Process.cs
- ResourceDictionary.cs
- FastPropertyAccessor.cs
- ComboBox.cs
- CngKeyCreationParameters.cs
- ClaimComparer.cs
- ThreadAttributes.cs
- MenuBindingsEditorForm.cs
- DataServiceContext.cs
- MarkupCompilePass2.cs
- SqlParameter.cs
- CompoundFileDeflateTransform.cs
- Model3D.cs
- WebPartHeaderCloseVerb.cs
- ToolStripContentPanel.cs
- ToolTipService.cs
- ToolStripItemTextRenderEventArgs.cs
- TraversalRequest.cs
- XmlMessageFormatter.cs
- WindowsListViewSubItem.cs
- HeaderedContentControl.cs
- FloatUtil.cs
- SqlTypesSchemaImporter.cs
- FormViewPagerRow.cs
- TableLayoutStyle.cs
- Emitter.cs
- StylusPoint.cs
- SHA1.cs
- XmlAnyElementAttributes.cs
- FamilyMap.cs
- SerialErrors.cs
- Sentence.cs
- DocumentSchemaValidator.cs
- DataView.cs
- XmlNodeChangedEventArgs.cs
- RestHandlerFactory.cs
- AdornerDecorator.cs
- IndentedWriter.cs
- TextRangeProviderWrapper.cs
- OperationAbortedException.cs
- TextRange.cs
- WebPartTransformer.cs
- TrackBarRenderer.cs
- pingexception.cs
- IFlowDocumentViewer.cs
- XmlSchemaAnnotation.cs
- CryptoApi.cs
- BoolLiteral.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- EditorResources.cs
- LightweightCodeGenerator.cs
- ThicknessAnimationUsingKeyFrames.cs
- CodeNamespace.cs
- AttributeQuery.cs
- UTF7Encoding.cs
- WindowsAuthenticationEventArgs.cs
- SizeKeyFrameCollection.cs
- CatalogPartChrome.cs
- StorageInfo.cs
- XsltException.cs
- NativeRecognizer.cs
- TextBoxView.cs
- QueryOutputWriter.cs