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
- Size3DValueSerializer.cs
- RtfToken.cs
- MissingManifestResourceException.cs
- ValidatingReaderNodeData.cs
- AnnotationStore.cs
- InstanceLockedException.cs
- HtmlInputPassword.cs
- Menu.cs
- NativeMethods.cs
- RegexCode.cs
- RadioButtonFlatAdapter.cs
- TargetException.cs
- EnumerationRangeValidationUtil.cs
- ControlParameter.cs
- SetterBase.cs
- SettingsContext.cs
- Focus.cs
- ParallelTimeline.cs
- UnauthorizedWebPart.cs
- Button.cs
- XsltCompileContext.cs
- DeferredSelectedIndexReference.cs
- InvokeWebServiceDesigner.cs
- RMPublishingDialog.cs
- VectorKeyFrameCollection.cs
- OleDbRowUpdatedEvent.cs
- RawAppCommandInputReport.cs
- ProtocolElementCollection.cs
- XmlSerializableWriter.cs
- ProtocolsConfigurationEntry.cs
- SmiSettersStream.cs
- WebContext.cs
- FrameworkName.cs
- DashStyles.cs
- UIElement3D.cs
- BrowserInteropHelper.cs
- Pens.cs
- NavigationProperty.cs
- BitmapEffectvisualstate.cs
- HotSpotCollection.cs
- TableParagraph.cs
- Int16Storage.cs
- ValueChangedEventManager.cs
- DbgUtil.cs
- CustomAttributeFormatException.cs
- SmtpFailedRecipientException.cs
- HiddenField.cs
- Merger.cs
- ExtenderControl.cs
- Token.cs
- ApplicationManager.cs
- ColumnHeader.cs
- NamespaceCollection.cs
- SettingsContext.cs
- InheritanceContextHelper.cs
- HtmlSelect.cs
- shaperfactory.cs
- PeerApplication.cs
- DataSvcMapFileSerializer.cs
- TemplatedMailWebEventProvider.cs
- AuthenticatingEventArgs.cs
- UnsafeNativeMethods.cs
- TraversalRequest.cs
- AncestorChangedEventArgs.cs
- SqlDataAdapter.cs
- GridViewUpdatedEventArgs.cs
- ExpressionBuilder.cs
- ServiceObjectContainer.cs
- EventData.cs
- GridViewRowEventArgs.cs
- DbDataSourceEnumerator.cs
- CharacterString.cs
- oledbconnectionstring.cs
- DesignerUtils.cs
- Debug.cs
- FormParameter.cs
- InkCanvasFeedbackAdorner.cs
- AutomationEvent.cs
- SystemIPGlobalProperties.cs
- RolePrincipal.cs
- CatalogPartCollection.cs
- ToolboxItem.cs
- HostingEnvironmentWrapper.cs
- SqlUtil.cs
- WebPartUserCapability.cs
- LookupBindingPropertiesAttribute.cs
- GradientStop.cs
- WebScriptMetadataMessageEncoderFactory.cs
- HealthMonitoringSectionHelper.cs
- BindingExpression.cs
- PersonalizationStateInfoCollection.cs
- PlatformNotSupportedException.cs
- IFlowDocumentViewer.cs
- CorrelationManager.cs
- PrinterSettings.cs
- LongValidatorAttribute.cs
- SpecialNameAttribute.cs
- ChannelFactoryBase.cs
- sapiproxy.cs
- CharEnumerator.cs