Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / WebParts / WebPartTracker.cs / 1 / WebPartTracker.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls.WebParts { using System; using System.Collections; using System.ComponentModel; using System.Diagnostics; using System.Drawing.Design; using System.Security.Permissions; using System.Web; using System.Web.UI; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class WebPartTracker : IDisposable { private bool _disposed; private WebPart _webPart; private ProviderConnectionPoint _providerConnectionPoint; public WebPartTracker(WebPart webPart, ProviderConnectionPoint providerConnectionPoint) { if (webPart == null) { throw new ArgumentNullException("webPart"); } if (providerConnectionPoint == null) { throw new ArgumentNullException("providerConnectionPoint"); } if (providerConnectionPoint.ControlType != webPart.GetType()) { throw new ArgumentException(SR.GetString(SR.WebPartManager_InvalidConnectionPoint), "providerConnectionPoint"); } _webPart = webPart; _providerConnectionPoint = providerConnectionPoint; if (++Count > 1) { webPart.SetConnectErrorMessage(SR.GetString( SR.WebPartTracker_CircularConnection, _providerConnectionPoint.DisplayName)); } } public bool IsCircularConnection { get { return (Count > 1); } } private int Count { get { int count; _webPart.TrackerCounter.TryGetValue(_providerConnectionPoint, out count); return count; } set { _webPart.TrackerCounter[_providerConnectionPoint] = value; } } void IDisposable.Dispose() { if (!_disposed) { Debug.Assert(Count >= 1); Count--; _disposed = true; } } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OdbcFactory.cs
- UpdatePanelTriggerCollection.cs
- GridItem.cs
- ProfileGroupSettings.cs
- SymbolEqualComparer.cs
- ImageList.cs
- OperationContractAttribute.cs
- WebPartDescription.cs
- CodeFieldReferenceExpression.cs
- ServiceThrottlingElement.cs
- ThicknessConverter.cs
- DataFieldEditor.cs
- TreeBuilderBamlTranslator.cs
- SingleTagSectionHandler.cs
- Inline.cs
- MergePropertyDescriptor.cs
- HttpModuleActionCollection.cs
- InfoCardSymmetricAlgorithm.cs
- ButtonRenderer.cs
- EventLogTraceListener.cs
- NavigatingCancelEventArgs.cs
- OutputCacheProfileCollection.cs
- PropertyGridView.cs
- FormsAuthenticationTicket.cs
- HtmlPhoneCallAdapter.cs
- SQLGuidStorage.cs
- ExpressionLexer.cs
- InputLanguageCollection.cs
- InternalConfigConfigurationFactory.cs
- ChildTable.cs
- PageRequestManager.cs
- CompilationUtil.cs
- ResXFileRef.cs
- ModuleElement.cs
- TypeElementCollection.cs
- RegionIterator.cs
- WinFormsUtils.cs
- RPIdentityRequirement.cs
- XmlException.cs
- Dynamic.cs
- FontWeights.cs
- PageAsyncTaskManager.cs
- Event.cs
- SequenceFullException.cs
- connectionpool.cs
- EncryptedData.cs
- FolderBrowserDialog.cs
- BamlLocalizationDictionary.cs
- Transform3DGroup.cs
- ThemeableAttribute.cs
- TableChangeProcessor.cs
- MachineKey.cs
- DiscoveryMessageSequence11.cs
- BuildProviderUtils.cs
- ValidatingReaderNodeData.cs
- PeerCollaborationPermission.cs
- XamlPointCollectionSerializer.cs
- ListDesigner.cs
- DataGridViewRowCollection.cs
- FixedDSBuilder.cs
- XmlTypeAttribute.cs
- DictionaryEntry.cs
- ECDiffieHellmanCngPublicKey.cs
- MouseEventArgs.cs
- Perspective.cs
- ListControl.cs
- ProtocolsConfigurationEntry.cs
- _SSPIWrapper.cs
- cookie.cs
- TdsParserStateObject.cs
- PropertyDescriptor.cs
- XmlWriter.cs
- LoginName.cs
- CallbackValidator.cs
- UpdateDelegates.Generated.cs
- Facet.cs
- MinMaxParagraphWidth.cs
- PointAnimationUsingKeyFrames.cs
- WebPartEventArgs.cs
- UniqueIdentifierService.cs
- CachedFontFamily.cs
- XmlSchemaObject.cs
- RemotingConfiguration.cs
- BinaryCommonClasses.cs
- TextDecoration.cs
- Buffer.cs
- FileDialog.cs
- MailAddressCollection.cs
- CustomError.cs
- PeerNearMe.cs
- Types.cs
- EmbeddedMailObject.cs
- EntityDataSourceChangingEventArgs.cs
- DBCSCodePageEncoding.cs
- ComplexBindingPropertiesAttribute.cs
- _SslSessionsCache.cs
- SourceItem.cs
- GreenMethods.cs
- IntranetCredentialPolicy.cs
- CollectionContainer.cs