Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / SetterBaseCollection.cs / 1305600 / 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
- GridViewRowCollection.cs
- SqlCacheDependencyDatabaseCollection.cs
- ImageConverter.cs
- MediaPlayerState.cs
- StackBuilderSink.cs
- assemblycache.cs
- UnitySerializationHolder.cs
- InheritanceContextHelper.cs
- FileDialogCustomPlacesCollection.cs
- ACL.cs
- SystemIcons.cs
- BmpBitmapDecoder.cs
- ColumnCollection.cs
- XmlSchemaSet.cs
- Suspend.cs
- HostProtectionException.cs
- BaseParser.cs
- WebConvert.cs
- ViewManager.cs
- JsonByteArrayDataContract.cs
- Crypto.cs
- FileVersion.cs
- WindowsAltTab.cs
- SafeBitVector32.cs
- VideoDrawing.cs
- MsmqElementBase.cs
- ChangeToolStripParentVerb.cs
- TypeDependencyAttribute.cs
- IsolationInterop.cs
- DefinitionBase.cs
- CodeAttributeArgumentCollection.cs
- CodeTypeDeclarationCollection.cs
- InstancePersistenceEvent.cs
- FunctionImportElement.cs
- PixelShader.cs
- HtmlSelect.cs
- _AcceptOverlappedAsyncResult.cs
- odbcmetadatacolumnnames.cs
- DateTimeValueSerializerContext.cs
- PersonalizationDictionary.cs
- XLinq.cs
- BuildProviderAppliesToAttribute.cs
- EmptyTextWriter.cs
- CodeStatementCollection.cs
- UnsafePeerToPeerMethods.cs
- BaseDataList.cs
- GraphicsContainer.cs
- ToggleProviderWrapper.cs
- ProfileGroupSettingsCollection.cs
- BuildProvidersCompiler.cs
- Geometry3D.cs
- ColorTranslator.cs
- SspiHelper.cs
- SessionState.cs
- BuildDependencySet.cs
- Baml6Assembly.cs
- COM2ColorConverter.cs
- CheckBoxList.cs
- SecurityDescriptor.cs
- RichTextBox.cs
- SpecularMaterial.cs
- TextPointer.cs
- IpcManager.cs
- BookmarkScopeHandle.cs
- HttpResponse.cs
- SerializerWriterEventHandlers.cs
- XmlNodeChangedEventArgs.cs
- SBCSCodePageEncoding.cs
- TextRange.cs
- FloatSumAggregationOperator.cs
- UndirectedGraph.cs
- FileNotFoundException.cs
- AutoScrollExpandMessageFilter.cs
- SafeMarshalContext.cs
- InkCollectionBehavior.cs
- RelationshipConstraintValidator.cs
- tabpagecollectioneditor.cs
- Grid.cs
- DataBindingHandlerAttribute.cs
- _RequestCacheProtocol.cs
- CodeMethodReturnStatement.cs
- StringAttributeCollection.cs
- SwitchElementsCollection.cs
- ResizeGrip.cs
- HashHelper.cs
- AnchoredBlock.cs
- Geometry.cs
- SecurityTokenTypes.cs
- RadioButton.cs
- SoapTypeAttribute.cs
- BinaryConverter.cs
- DocumentReferenceCollection.cs
- BookmarkResumptionRecord.cs
- FloaterBaseParaClient.cs
- EventEntry.cs
- EmptyStringExpandableObjectConverter.cs
- GridSplitterAutomationPeer.cs
- GroupByQueryOperator.cs
- WebPartConnectionsDisconnectVerb.cs
- ThreadAttributes.cs