Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / TriggerCollection.cs / 1 / TriggerCollection.cs
/****************************************************************************\ * * File: TriggerCollection.cs * * A collection of TriggerBase-derived classes. See use in Style.cs and other * places. * * Copyright (C) by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System.Diagnostics; using System.Collections.Generic; using System.Collections.ObjectModel; // Collectionusing MS.Internal; namespace System.Windows { /// /// A set of TriggerBase's /// [Localizability(LocalizationCategory.None, Readability=Readability.Unreadable)] public sealed class TriggerCollection : Collection{ #region Constructors internal TriggerCollection() : this(null) { } internal TriggerCollection(FrameworkElement owner) : base() { _sealed = false; _owner = owner; } #endregion Constructors #region ProtectedMethods /// /// ClearItems override /// protected override void ClearItems() { CheckSealed(); OnClear(); base.ClearItems(); } ////// InsertItem override /// protected override void InsertItem(int index, TriggerBase item) { CheckSealed(); TriggerBaseValidation(item); OnAdd(item); base.InsertItem(index, item); } ////// RemoveItem override /// protected override void RemoveItem(int index) { CheckSealed(); TriggerBase triggerBase = this[index]; OnRemove(triggerBase); base.RemoveItem(index); } ////// SetItem override /// protected override void SetItem(int index, TriggerBase item) { CheckSealed(); TriggerBaseValidation(item); OnAdd(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() { Debug.Assert (Owner == null); _sealed = true; // Seal all the setters for (int i=0; i= 0; i--) { InheritanceContextHelper.RemoveContextFromObject(Owner, this[i]); } } } #endregion PrivateMethods #region Data private bool _sealed; private FrameworkElement _owner; #endregion Data } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. /****************************************************************************\ * * File: TriggerCollection.cs * * A collection of TriggerBase-derived classes. See use in Style.cs and other * places. * * Copyright (C) by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System.Diagnostics; using System.Collections.Generic; using System.Collections.ObjectModel; // Collection using MS.Internal; namespace System.Windows { /// /// A set of TriggerBase's /// [Localizability(LocalizationCategory.None, Readability=Readability.Unreadable)] public sealed class TriggerCollection : Collection{ #region Constructors internal TriggerCollection() : this(null) { } internal TriggerCollection(FrameworkElement owner) : base() { _sealed = false; _owner = owner; } #endregion Constructors #region ProtectedMethods /// /// ClearItems override /// protected override void ClearItems() { CheckSealed(); OnClear(); base.ClearItems(); } ////// InsertItem override /// protected override void InsertItem(int index, TriggerBase item) { CheckSealed(); TriggerBaseValidation(item); OnAdd(item); base.InsertItem(index, item); } ////// RemoveItem override /// protected override void RemoveItem(int index) { CheckSealed(); TriggerBase triggerBase = this[index]; OnRemove(triggerBase); base.RemoveItem(index); } ////// SetItem override /// protected override void SetItem(int index, TriggerBase item) { CheckSealed(); TriggerBaseValidation(item); OnAdd(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() { Debug.Assert (Owner == null); _sealed = true; // Seal all the setters for (int i=0; i= 0; i--) { InheritanceContextHelper.RemoveContextFromObject(Owner, this[i]); } } } #endregion PrivateMethods #region Data private bool _sealed; private FrameworkElement _owner; #endregion Data } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CultureInfo.cs
- DictionaryBase.cs
- DefaultTextStoreTextComposition.cs
- SafeArrayTypeMismatchException.cs
- NameGenerator.cs
- CapabilitiesSection.cs
- Utils.cs
- IconConverter.cs
- Internal.cs
- FormViewInsertedEventArgs.cs
- CopyNodeSetAction.cs
- CompilationSection.cs
- DescendantBaseQuery.cs
- LexicalChunk.cs
- HostingEnvironmentException.cs
- OutputChannel.cs
- SafeBitVector32.cs
- FormViewCommandEventArgs.cs
- Matrix.cs
- LicenseManager.cs
- ConfigurationManagerInternal.cs
- WebPartZone.cs
- GregorianCalendar.cs
- IteratorDescriptor.cs
- SqlOuterApplyReducer.cs
- SpotLight.cs
- CqlBlock.cs
- X509Certificate.cs
- InstanceBehavior.cs
- TemplateControlParser.cs
- DEREncoding.cs
- PathFigureCollection.cs
- ConnectionsZone.cs
- ComponentResourceKeyConverter.cs
- ExclusiveHandle.cs
- IndicShape.cs
- TickBar.cs
- TextAdaptor.cs
- EventsTab.cs
- WindowsPen.cs
- DataDocumentXPathNavigator.cs
- DataTransferEventArgs.cs
- FontInfo.cs
- SiteMapNodeItem.cs
- RequiredFieldValidator.cs
- AccessControlEntry.cs
- LocalizabilityAttribute.cs
- MethodRental.cs
- DataGridrowEditEndingEventArgs.cs
- IndexedGlyphRun.cs
- GlyphsSerializer.cs
- PartitionerQueryOperator.cs
- CredentialCache.cs
- EnumBuilder.cs
- AttributeProviderAttribute.cs
- RuleAction.cs
- MessagingDescriptionAttribute.cs
- SafeNativeMethods.cs
- UnsafeNativeMethods.cs
- NativeMethodsCLR.cs
- LinqDataSource.cs
- IndexerNameAttribute.cs
- DelegateTypeInfo.cs
- Vector3DAnimationBase.cs
- HtmlInputCheckBox.cs
- Form.cs
- InputMethodStateChangeEventArgs.cs
- Formatter.cs
- DefaultHttpHandler.cs
- RootBrowserWindow.cs
- XhtmlTextWriter.cs
- EntitySqlQueryState.cs
- ItemsControl.cs
- BooleanProjectedSlot.cs
- ComplexPropertyEntry.cs
- VectorCollectionValueSerializer.cs
- ConversionContext.cs
- XmlSecureResolver.cs
- SchemaElementDecl.cs
- MSG.cs
- WindowAutomationPeer.cs
- ActiveDocumentEvent.cs
- ExcCanonicalXml.cs
- Stream.cs
- SqlTriggerAttribute.cs
- DPTypeDescriptorContext.cs
- MimeTypeAttribute.cs
- InvalidPrinterException.cs
- DataGridViewLinkCell.cs
- WebDescriptionAttribute.cs
- RawStylusInput.cs
- EntityDataSourceWizardForm.cs
- Executor.cs
- ChildChangedEventArgs.cs
- EventTrigger.cs
- WsdlEndpointConversionContext.cs
- FileIOPermission.cs
- Vector3DValueSerializer.cs
- BrowserPolicyValidator.cs
- EventToken.cs