Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WmfPlaceableFileHeader.cs
- WebHostScriptMappingsInstallComponent.cs
- GlobalProxySelection.cs
- TrackingAnnotationCollection.cs
- PartDesigner.cs
- Delegate.cs
- HandlerMappingMemo.cs
- ZipIOExtraField.cs
- MD5.cs
- util.cs
- EdmPropertyAttribute.cs
- ElementsClipboardData.cs
- ImageCollectionEditor.cs
- GridToolTip.cs
- AuthenticationModulesSection.cs
- AttachInfo.cs
- ScrollChrome.cs
- DataGridCommandEventArgs.cs
- cookiecollection.cs
- NamespaceDisplay.xaml.cs
- InlineObject.cs
- RunInstallerAttribute.cs
- Geometry3D.cs
- ZeroOpNode.cs
- DocumentViewerAutomationPeer.cs
- QilVisitor.cs
- Int32CAMarshaler.cs
- PixelFormat.cs
- IconConverter.cs
- ControlDesigner.cs
- ToolStripItemCollection.cs
- TextServicesCompartmentContext.cs
- ObsoleteAttribute.cs
- SerialErrors.cs
- WebPartDescriptionCollection.cs
- DetailsViewRow.cs
- HttpHandlerActionCollection.cs
- HtmlSelect.cs
- ObjectViewFactory.cs
- _HeaderInfo.cs
- DecoderFallback.cs
- StrokeNodeOperations.cs
- BitmapSizeOptions.cs
- TextServicesCompartmentContext.cs
- BasicCellRelation.cs
- HtmlInputReset.cs
- ScriptingRoleServiceSection.cs
- Exceptions.cs
- Error.cs
- DynamicILGenerator.cs
- BitmapFrame.cs
- ServiceBuildProvider.cs
- PartitionedDataSource.cs
- _ShellExpression.cs
- _Win32.cs
- ApplicationCommands.cs
- ControllableStoryboardAction.cs
- StackOverflowException.cs
- AutomationFocusChangedEventArgs.cs
- ToolStripLocationCancelEventArgs.cs
- _Connection.cs
- RelationshipFixer.cs
- ScriptReferenceEventArgs.cs
- BulletedList.cs
- PropertyInformation.cs
- HashHelper.cs
- XmlArrayAttribute.cs
- HtmlInputReset.cs
- ForwardPositionQuery.cs
- GiveFeedbackEvent.cs
- CircleHotSpot.cs
- IsolatedStorageException.cs
- BrowserCapabilitiesFactory.cs
- DataGridHeaderBorder.cs
- HashCodeCombiner.cs
- TypeResolver.cs
- CodeExpressionRuleDeclaration.cs
- GridViewColumnHeaderAutomationPeer.cs
- DefaultBinder.cs
- SafeRegistryHandle.cs
- Permission.cs
- Validator.cs
- smtpconnection.cs
- ProfessionalColorTable.cs
- IUnknownConstantAttribute.cs
- _DisconnectOverlappedAsyncResult.cs
- Persist.cs
- ACL.cs
- DataGridColumnHeadersPresenter.cs
- WebPart.cs
- IsolationInterop.cs
- AdRotator.cs
- OutKeywords.cs
- IArgumentProvider.cs
- RotateTransform.cs
- SoapMessage.cs
- StorageInfo.cs
- InstanceBehavior.cs
- EntityViewGenerationAttribute.cs
- WebPartConnectionsCancelEventArgs.cs