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
- ToolStripComboBox.cs
- StrokeNode.cs
- PeerDuplexChannelListener.cs
- ProvidePropertyAttribute.cs
- BitmapMetadataBlob.cs
- Thickness.cs
- SequentialWorkflowRootDesigner.cs
- DataGridViewCellStyleConverter.cs
- ThreadAbortException.cs
- FormViewPagerRow.cs
- CalendarAutoFormat.cs
- TextFormattingConverter.cs
- BufferedReadStream.cs
- TextEditorSpelling.cs
- StylusPointPropertyInfoDefaults.cs
- coordinatorfactory.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- IndentedTextWriter.cs
- ValidateNames.cs
- LinkedResourceCollection.cs
- COM2Properties.cs
- WinFormsSecurity.cs
- Win32Native.cs
- PresentationSource.cs
- FileFormatException.cs
- ServiceBehaviorElement.cs
- base64Transforms.cs
- DataControlFieldCell.cs
- Inline.cs
- RNGCryptoServiceProvider.cs
- CharStorage.cs
- JsonReader.cs
- PopupRoot.cs
- X509AsymmetricSecurityKey.cs
- MediaElementAutomationPeer.cs
- IisTraceListener.cs
- WindowsStatic.cs
- BadImageFormatException.cs
- XmlWriterTraceListener.cs
- DefaultShape.cs
- XmlValidatingReader.cs
- ConnectionStringSettings.cs
- InputReportEventArgs.cs
- DateTimeValueSerializerContext.cs
- StrongNameKeyPair.cs
- WindowsStatic.cs
- WorkflowTransactionService.cs
- PropertyValue.cs
- ZoneIdentityPermission.cs
- CreateUserErrorEventArgs.cs
- PrintControllerWithStatusDialog.cs
- EntityDataSourceWrapperCollection.cs
- TextRenderer.cs
- DocumentXPathNavigator.cs
- COM2PropertyPageUITypeConverter.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- BooleanStorage.cs
- ClassHandlersStore.cs
- UserControlFileEditor.cs
- PeerNameRegistration.cs
- WebConfigurationHost.cs
- IsolatedStorageFile.cs
- XmlHierarchicalEnumerable.cs
- VolatileEnlistmentState.cs
- SspiSafeHandles.cs
- DomNameTable.cs
- TextAdaptor.cs
- MultiBindingExpression.cs
- SafeLocalMemHandle.cs
- HashHelper.cs
- Visitor.cs
- CheckBoxList.cs
- WindowsTooltip.cs
- SingleQueryOperator.cs
- GatewayDefinition.cs
- AmbiguousMatchException.cs
- XmlUtilWriter.cs
- InfoCardCryptoHelper.cs
- BitStack.cs
- XomlCompilerResults.cs
- OutputWindow.cs
- TransformGroup.cs
- RuntimeUtils.cs
- UpdateEventArgs.cs
- DebugHandleTracker.cs
- DetailsViewUpdatedEventArgs.cs
- List.cs
- SignatureToken.cs
- BuildManagerHost.cs
- StagingAreaInputItem.cs
- NumericUpDownAccelerationCollection.cs
- MailWriter.cs
- FixUpCollection.cs
- ExpanderAutomationPeer.cs
- Point3DValueSerializer.cs
- Selector.cs
- WebScriptEnablingBehavior.cs
- TextPenaltyModule.cs
- DatagridviewDisplayedBandsData.cs
- XsdCachingReader.cs