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
- UpdateCompiler.cs
- SafeLocalAllocation.cs
- CacheVirtualItemsEvent.cs
- AssemblyHash.cs
- BuildProvider.cs
- Typeface.cs
- HttpListenerContext.cs
- TableProvider.cs
- SqlClientPermission.cs
- InlineUIContainer.cs
- TemplateBaseAction.cs
- XmlLanguageConverter.cs
- DataGridViewCellValueEventArgs.cs
- SmtpDigestAuthenticationModule.cs
- DoubleUtil.cs
- HtmlInputReset.cs
- MimeObjectFactory.cs
- DefaultMemberAttribute.cs
- ParenthesizePropertyNameAttribute.cs
- ModuleBuilderData.cs
- SizeAnimationClockResource.cs
- QuadTree.cs
- StringResourceManager.cs
- ToolStripLabel.cs
- DataGridHelper.cs
- IsolatedStorage.cs
- BaseResourcesBuildProvider.cs
- CustomPopupPlacement.cs
- WebPartMinimizeVerb.cs
- AssemblySettingAttributes.cs
- TextContainer.cs
- DoubleMinMaxAggregationOperator.cs
- FtpWebResponse.cs
- Matrix3D.cs
- WebPartConnectionCollection.cs
- ECDsaCng.cs
- AnnotationHelper.cs
- UTF32Encoding.cs
- ArcSegment.cs
- XmlNodeChangedEventManager.cs
- DynamicUpdateCommand.cs
- Command.cs
- CacheAxisQuery.cs
- ResponseBodyWriter.cs
- DecimalConstantAttribute.cs
- CreatingCookieEventArgs.cs
- SystemThemeKey.cs
- HashAlgorithm.cs
- Privilege.cs
- EntityDataSourceWizardForm.cs
- DataListDesigner.cs
- FunctionDescription.cs
- ToolStripSplitStackLayout.cs
- Blend.cs
- ImmutablePropertyDescriptorGridEntry.cs
- XPathBinder.cs
- CodeConditionStatement.cs
- BaseDataList.cs
- ConfigXmlCDataSection.cs
- PenLineCapValidation.cs
- TemplateBamlRecordReader.cs
- RichTextBoxContextMenu.cs
- DecoderNLS.cs
- AbandonedMutexException.cs
- validation.cs
- RawStylusInput.cs
- SR.cs
- RecordBuilder.cs
- PrintPreviewDialog.cs
- SafeFileHandle.cs
- GridViewAutoFormat.cs
- ViewDesigner.cs
- TableCellCollection.cs
- ConfigurationStrings.cs
- GroupBoxRenderer.cs
- SmiMetaDataProperty.cs
- DataGridViewCellValidatingEventArgs.cs
- AppDomainProtocolHandler.cs
- SafeProcessHandle.cs
- HeaderCollection.cs
- CmsUtils.cs
- NaturalLanguageHyphenator.cs
- XmlElement.cs
- GlobalProxySelection.cs
- MemberProjectionIndex.cs
- FacetDescriptionElement.cs
- LinqDataSourceDeleteEventArgs.cs
- ColorTransformHelper.cs
- HwndSourceParameters.cs
- CopyOfAction.cs
- ManifestResourceInfo.cs
- TextSegment.cs
- XmlReader.cs
- XmlSchemaAnnotation.cs
- EntityClientCacheKey.cs
- ComponentResourceKeyConverter.cs
- BitVector32.cs
- ActivityScheduledRecord.cs
- RoleGroup.cs
- RawStylusInput.cs