Code:
/ DotNET / DotNET / 8.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
- GridViewUpdateEventArgs.cs
- FixedStringLookup.cs
- SchemaImporterExtensionsSection.cs
- Color.cs
- GridViewCellAutomationPeer.cs
- QueryableDataSourceHelper.cs
- ReadOnlyTernaryTree.cs
- SqlComparer.cs
- ValidationErrorEventArgs.cs
- DesignerTransaction.cs
- DefaultTraceListener.cs
- PageRequestManager.cs
- IndexOutOfRangeException.cs
- WebPartConnectVerb.cs
- ListView.cs
- PreservationFileWriter.cs
- MexNamedPipeBindingCollectionElement.cs
- TypeUtil.cs
- MetadataArtifactLoaderFile.cs
- StringValueSerializer.cs
- GlobalEventManager.cs
- DocumentDesigner.cs
- DataControlFieldCell.cs
- SHA1Managed.cs
- FixedDocumentPaginator.cs
- DataGridCellEditEndingEventArgs.cs
- EpmContentSerializerBase.cs
- EntityDesignerUtils.cs
- AnnotationObservableCollection.cs
- _NetRes.cs
- UserInitiatedNavigationPermission.cs
- ExpandedWrapper.cs
- Claim.cs
- EntityProviderFactory.cs
- ToolStripStatusLabel.cs
- ImageFormat.cs
- MyContact.cs
- QueryResponse.cs
- ImagingCache.cs
- SiteMapNodeItemEventArgs.cs
- RegexStringValidatorAttribute.cs
- ImmutableObjectAttribute.cs
- WebHttpBinding.cs
- StreamInfo.cs
- AliasGenerator.cs
- DataGridViewCellConverter.cs
- EntityClassGenerator.cs
- coordinatorfactory.cs
- _ContextAwareResult.cs
- ColumnClickEvent.cs
- EntityDataSource.cs
- WebInvokeAttribute.cs
- CookieProtection.cs
- OracleRowUpdatingEventArgs.cs
- CompensationToken.cs
- TreeViewDesigner.cs
- GenericAuthenticationEventArgs.cs
- LineBreak.cs
- MachineSettingsSection.cs
- DataSourceControl.cs
- UserCancellationException.cs
- BindingMAnagerBase.cs
- XmlWrappingWriter.cs
- RecognitionResult.cs
- VariableDesigner.xaml.cs
- FlowDocumentPageViewerAutomationPeer.cs
- TaskFileService.cs
- PlatformNotSupportedException.cs
- ContentPathSegment.cs
- ResourceAttributes.cs
- EntityWithChangeTrackerStrategy.cs
- PropagatorResult.cs
- MonitoringDescriptionAttribute.cs
- DecimalStorage.cs
- DSASignatureDeformatter.cs
- EntitySet.cs
- CategoryEditor.cs
- DocComment.cs
- BaseParagraph.cs
- DiagnosticsConfigurationHandler.cs
- DbParameterCollectionHelper.cs
- OdbcCommand.cs
- SortedDictionary.cs
- NavigatorOutput.cs
- CircleHotSpot.cs
- Utils.cs
- ping.cs
- LambdaCompiler.cs
- ErrorEventArgs.cs
- StylusEditingBehavior.cs
- SoundPlayerAction.cs
- Latin1Encoding.cs
- TemplatedAdorner.cs
- InkCanvasInnerCanvas.cs
- SecurityPolicySection.cs
- ValueProviderWrapper.cs
- AnimationClock.cs
- FileDataSourceCache.cs
- List.cs
- ToolStripRenderEventArgs.cs