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
- ConnectionInterfaceCollection.cs
- CustomWebEventKey.cs
- RSAProtectedConfigurationProvider.cs
- CfgArc.cs
- XmlSchemaAnyAttribute.cs
- PropertyDescriptors.cs
- CqlBlock.cs
- _AuthenticationState.cs
- ControlBuilderAttribute.cs
- PropertyPath.cs
- AlphaSortedEnumConverter.cs
- ProcessModelSection.cs
- SqlDataSourceDesigner.cs
- SqlMethods.cs
- UIInitializationException.cs
- MenuItemStyle.cs
- XmlHelper.cs
- SqlUdtInfo.cs
- BitmapEffectRenderDataResource.cs
- RepeatBehavior.cs
- EventSinkHelperWriter.cs
- FixedSOMLineRanges.cs
- TextContainerHelper.cs
- DataGridViewBindingCompleteEventArgs.cs
- Number.cs
- DesignBindingEditor.cs
- CreateRefExpr.cs
- LogicalTreeHelper.cs
- HwndHost.cs
- WindowsFormsHost.cs
- CrossSiteScriptingValidation.cs
- UITypeEditor.cs
- TreeNodeMouseHoverEvent.cs
- TextWriterTraceListener.cs
- CodeArgumentReferenceExpression.cs
- Emitter.cs
- SubpageParaClient.cs
- TableSectionStyle.cs
- ObjectReferenceStack.cs
- SettingsContext.cs
- PieceDirectory.cs
- StateBag.cs
- X509SecurityTokenAuthenticator.cs
- RemoteWebConfigurationHost.cs
- NamedPipeActivation.cs
- BitSet.cs
- DataServiceContext.cs
- TextUtf8RawTextWriter.cs
- PageClientProxyGenerator.cs
- AgileSafeNativeMemoryHandle.cs
- TraversalRequest.cs
- AssemblyCache.cs
- GenerateHelper.cs
- SharedPerformanceCounter.cs
- ConnectionPoolRegistry.cs
- HtmlInputSubmit.cs
- CookielessHelper.cs
- precedingsibling.cs
- ProgressBar.cs
- ToolStripSystemRenderer.cs
- XmlSubtreeReader.cs
- StringOutput.cs
- DataIdProcessor.cs
- GACIdentityPermission.cs
- HtmlControl.cs
- SkewTransform.cs
- UmAlQuraCalendar.cs
- DelegatingChannelListener.cs
- ObjectConverter.cs
- GenericWebPart.cs
- CultureSpecificStringDictionary.cs
- DependencyPropertyKind.cs
- Helper.cs
- ProxyAttribute.cs
- ButtonBase.cs
- Base64Encoding.cs
- SqlRowUpdatedEvent.cs
- DbUpdateCommandTree.cs
- CurrencyWrapper.cs
- SqlErrorCollection.cs
- FunctionGenerator.cs
- FillErrorEventArgs.cs
- TreeNodeCollection.cs
- HtmlContainerControl.cs
- WebPartManager.cs
- RoutedEvent.cs
- IDQuery.cs
- Guid.cs
- CriticalFinalizerObject.cs
- BuildResultCache.cs
- ToolStripSettings.cs
- SatelliteContractVersionAttribute.cs
- SettingsPropertyNotFoundException.cs
- StaticDataManager.cs
- FlowDocumentView.cs
- EndpointAddressMessageFilterTable.cs
- DescendentsWalker.cs
- AutomationPropertyInfo.cs
- XmlDictionaryReaderQuotas.cs
- XmlSchemaCollection.cs