Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- ListSurrogate.cs
- RemotingSurrogateSelector.cs
- GroupBox.cs
- ScaleTransform.cs
- UrlMappingCollection.cs
- DataGridViewCellEventArgs.cs
- NetworkStream.cs
- FrameAutomationPeer.cs
- ValidationHelper.cs
- ActiveXContainer.cs
- ToolBar.cs
- CloudCollection.cs
- MessageDecoder.cs
- CanExecuteRoutedEventArgs.cs
- RuntimeConfig.cs
- XmlTextReaderImplHelpers.cs
- _NestedMultipleAsyncResult.cs
- InputReportEventArgs.cs
- ListViewItem.cs
- HttpListenerResponse.cs
- DomNameTable.cs
- BindingContext.cs
- ServicePoint.cs
- DataGridViewCellMouseEventArgs.cs
- Attributes.cs
- StyleModeStack.cs
- LogoValidationException.cs
- RegistryKey.cs
- TdsParserSafeHandles.cs
- XPathNodeList.cs
- PartialCachingControl.cs
- ExpressionBuilderCollection.cs
- BindToObject.cs
- MessageQueueException.cs
- PrivilegeNotHeldException.cs
- UserControlAutomationPeer.cs
- Adorner.cs
- ObjectHandle.cs
- OdbcStatementHandle.cs
- EventEntry.cs
- DataGridDetailsPresenter.cs
- ControlPropertyNameConverter.cs
- BooleanFunctions.cs
- AnnotationResourceChangedEventArgs.cs
- InputScopeManager.cs
- PaperSize.cs
- AnnotationStore.cs
- AssociationTypeEmitter.cs
- InputQueueChannel.cs
- FontWeights.cs
- RowVisual.cs
- ObjectStateFormatter.cs
- SelectionItemProviderWrapper.cs
- DataGridViewAccessibleObject.cs
- XPathBinder.cs
- SiteMapPath.cs
- XslAstAnalyzer.cs
- MailWriter.cs
- WindowsListBox.cs
- Operand.cs
- NetworkCredential.cs
- ExpressionCopier.cs
- MonitorWrapper.cs
- AssemblyInfo.cs
- Subtract.cs
- DesignTimeParseData.cs
- BasicBrowserDialog.cs
- XmlMemberMapping.cs
- UpDownEvent.cs
- COAUTHIDENTITY.cs
- wgx_commands.cs
- fixedPageContentExtractor.cs
- Decoder.cs
- GridProviderWrapper.cs
- _NegotiateClient.cs
- HttpResponse.cs
- BuilderPropertyEntry.cs
- Choices.cs
- GeneralTransform3DTo2DTo3D.cs
- Point3DKeyFrameCollection.cs
- GridLength.cs
- NavigationFailedEventArgs.cs
- ProtocolsConfiguration.cs
- DataGridBoundColumn.cs
- TableLayoutPanelCellPosition.cs
- SevenBitStream.cs
- FontInfo.cs
- DecimalAnimationUsingKeyFrames.cs
- ExpressionParser.cs
- HttpWrapper.cs
- WebPartTransformer.cs
- AliasExpr.cs
- ProxyManager.cs
- FacetEnabledSchemaElement.cs
- ToolStripPanel.cs
- WindowsFormsHostPropertyMap.cs
- EventRoute.cs
- Calendar.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- AssemblyBuilderData.cs