Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / SetterBaseCollection.cs / 1 / SetterBaseCollection.cs
/****************************************************************************\ * * File: SetterBaseCollection.cs * * A collection of SetterBase-derived classes. See use in Style.cs and other * places. * * Copyright (C) by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System.Collections.ObjectModel; // Collectionusing System.Diagnostics; // Debug.Assert using System.Windows.Data; // Binding knowledge using System.Windows.Media; // Visual knowledge using System.Windows.Markup; // MarkupExtension namespace System.Windows { /// /// A collection of SetterBase objects to be used /// in Template and its trigger classes /// public sealed class SetterBaseCollection : Collection{ #region ProtectedMethods /// /// ClearItems override /// protected override void ClearItems() { CheckSealed(); base.ClearItems(); } ////// InsertItem override /// protected override void InsertItem(int index, SetterBase item) { CheckSealed(); SetterBaseValidation(item); base.InsertItem(index, item); } ////// RemoveItem override /// protected override void RemoveItem(int index) { CheckSealed(); base.RemoveItem(index); } ////// SetItem override /// protected override void SetItem(int index, SetterBase item) { CheckSealed(); SetterBaseValidation(item); base.SetItem(index, item); } #endregion ProtectedMethods #region PublicMethods ////// Returns the sealed state of this object. If true, any attempt /// at modifying the state of this object will trigger an exception. /// public bool IsSealed { get { return _sealed; } } #endregion PublicMethods #region InternalMethods internal void Seal() { _sealed = true; // Seal all the setters for (int i=0; iusing System.Diagnostics; // Debug.Assert using System.Windows.Data; // Binding knowledge using System.Windows.Media; // Visual knowledge using System.Windows.Markup; // MarkupExtension namespace System.Windows { /// /// A collection of SetterBase objects to be used /// in Template and its trigger classes /// public sealed class SetterBaseCollection : Collection{ #region ProtectedMethods /// /// ClearItems override /// protected override void ClearItems() { CheckSealed(); base.ClearItems(); } ////// InsertItem override /// protected override void InsertItem(int index, SetterBase item) { CheckSealed(); SetterBaseValidation(item); base.InsertItem(index, item); } ////// RemoveItem override /// protected override void RemoveItem(int index) { CheckSealed(); base.RemoveItem(index); } ////// SetItem override /// protected override void SetItem(int index, SetterBase item) { CheckSealed(); SetterBaseValidation(item); base.SetItem(index, item); } #endregion ProtectedMethods #region PublicMethods ////// Returns the sealed state of this object. If true, any attempt /// at modifying the state of this object will trigger an exception. /// public bool IsSealed { get { return _sealed; } } #endregion PublicMethods #region InternalMethods internal void Seal() { _sealed = true; // Seal all the setters for (int i=0; i
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XamlPathDataSerializer.cs
- Bookmark.cs
- InvalidateEvent.cs
- SoapAttributes.cs
- SubstitutionList.cs
- ManifestResourceInfo.cs
- Point3DConverter.cs
- X509CertificateTrustedIssuerElement.cs
- TransformGroup.cs
- DllNotFoundException.cs
- MembershipUser.cs
- SystemInfo.cs
- EntityDataSourceContextDisposingEventArgs.cs
- SqlGatherConsumedAliases.cs
- CodeGeneratorAttribute.cs
- TransactionTraceIdentifier.cs
- smtpconnection.cs
- TextTreeFixupNode.cs
- MobileControlPersister.cs
- HttpApplication.cs
- Utils.cs
- MappingModelBuildProvider.cs
- ExceptionWrapper.cs
- RbTree.cs
- SelectionEditor.cs
- CapabilitiesState.cs
- DataGridAddNewRow.cs
- SqlClientWrapperSmiStreamChars.cs
- AnimatedTypeHelpers.cs
- ExtendedProtectionPolicyElement.cs
- NegotiateStream.cs
- QueryableDataSourceView.cs
- BindStream.cs
- DefaultTraceListener.cs
- ExpanderAutomationPeer.cs
- HwndSubclass.cs
- LinqDataSourceContextEventArgs.cs
- TreeNodeStyleCollectionEditor.cs
- FormsAuthenticationUserCollection.cs
- InstanceDataCollection.cs
- SafeMILHandleMemoryPressure.cs
- _ChunkParse.cs
- TabControlAutomationPeer.cs
- ServicePointManager.cs
- ListControlConvertEventArgs.cs
- Component.cs
- followingquery.cs
- CodeConditionStatement.cs
- SkipStoryboardToFill.cs
- LocalClientSecuritySettingsElement.cs
- PolicyManager.cs
- Floater.cs
- CreateUserWizard.cs
- DataObjectCopyingEventArgs.cs
- WorkflowStateRollbackService.cs
- FocusWithinProperty.cs
- UserMapPath.cs
- MulticastNotSupportedException.cs
- FirstMatchCodeGroup.cs
- WorkItem.cs
- SemanticResultValue.cs
- StreamInfo.cs
- XmlSchemaInclude.cs
- XMLSyntaxException.cs
- NetworkStream.cs
- AccessedThroughPropertyAttribute.cs
- ErrorStyle.cs
- InvalidPrinterException.cs
- XmlDataSourceView.cs
- AsymmetricKeyExchangeDeformatter.cs
- DownloadProgressEventArgs.cs
- ListDependantCardsRequest.cs
- JournalEntryListConverter.cs
- XmlChildEnumerator.cs
- SqlNotificationRequest.cs
- ColumnTypeConverter.cs
- PatternMatcher.cs
- DeferredSelectedIndexReference.cs
- EpmAttributeNameBuilder.cs
- CqlBlock.cs
- DependencyObjectType.cs
- ServicesExceptionNotHandledEventArgs.cs
- CalendarTable.cs
- HttpRuntimeSection.cs
- KeySpline.cs
- MimeParameter.cs
- SchemaImporterExtensionElement.cs
- FormsIdentity.cs
- StylusPlugin.cs
- MexHttpBindingElement.cs
- MultiView.cs
- PairComparer.cs
- KeySpline.cs
- TCEAdapterGenerator.cs
- SymmetricCryptoHandle.cs
- QueryInterceptorAttribute.cs
- InternalConfigSettingsFactory.cs
- ResourcePart.cs
- ReferenceEqualityComparer.cs
- PropertyPushdownHelper.cs