Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Shared / MS / Internal / FreezableOperations.cs / 1 / FreezableOperations.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // Description: FreezableOperations class definition. // // History: // 2005/02/02 : [....] - Created // //--------------------------------------------------------------------------- using System; using System.Windows; using MS.Internal.PresentationCore; namespace MS.Internal { ////// Internal static class which provides helper methods for common /// Freezable operations. /// [FriendAccessAllowed] // Built into Core, also used by Framework. internal static class FreezableOperations { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- //------------------------------------------------------ // // Internal Methods // //----------------------------------------------------- #region Internal Methods ////// A null-safe wrapper around Freezable.Clone(). (If a null /// is encountered it returns null.) /// internal static Freezable Clone(Freezable freezable) { if (freezable == null) { return null; } return freezable.Clone(); } ////// Semantically equivilent to Freezable.Clone().Freeze() except that /// GetAsFrozen avoids copying any portions of the Freezable graph /// which are already frozen. /// public static Freezable GetAsFrozen(Freezable freezable) { if (freezable == null) { return null; } return freezable.GetAsFrozen(); } ////// If freezable is already frozen, it returns freezable /// If freezable is not frozen, it returns a copy that is frozen if possible /// internal static Freezable GetAsFrozenIfPossible(Freezable freezable) { if (freezable == null) { return null; } if (freezable.CanFreeze) { freezable = freezable.GetAsFrozen(); } return freezable; } ////// Moves the specified changed handler from the old value /// to the new value correctly no-oping nulls. This is useful /// for non-Freezables which expose a Freezable property. /// internal static void PropagateChangedHandlers( Freezable oldValue, Freezable newValue, EventHandler changedHandler) { if (newValue != null && !newValue.IsFrozen) { newValue.Changed += changedHandler; } if (oldValue != null && !oldValue.IsFrozen) { oldValue.Changed -= changedHandler; } } #endregion Internal Methods } } // 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
- CollectionConverter.cs
- AstTree.cs
- EventLog.cs
- DbConnectionStringCommon.cs
- mactripleDES.cs
- TemplateContent.cs
- OleDbRowUpdatingEvent.cs
- HitTestParameters3D.cs
- DecoderFallback.cs
- ColumnResizeAdorner.cs
- ContractCodeDomInfo.cs
- GridViewDeleteEventArgs.cs
- StickyNoteContentControl.cs
- Point3DIndependentAnimationStorage.cs
- PassportIdentity.cs
- Ipv6Element.cs
- ReadOnlyTernaryTree.cs
- ConfigXmlComment.cs
- DataDocumentXPathNavigator.cs
- LinkArea.cs
- SystemColorTracker.cs
- CompModSwitches.cs
- FloatSumAggregationOperator.cs
- StaticTextPointer.cs
- PathFigureCollection.cs
- Pkcs9Attribute.cs
- MailHeaderInfo.cs
- RTLAwareMessageBox.cs
- TypeUtil.cs
- RemotingAttributes.cs
- XmlSchemaSimpleContentRestriction.cs
- ConsumerConnectionPointCollection.cs
- UriParserTemplates.cs
- BaseTemplateCodeDomTreeGenerator.cs
- AssociationType.cs
- IISMapPath.cs
- DynamicResourceExtension.cs
- SchemaCollectionCompiler.cs
- InputScopeNameConverter.cs
- ListBindingConverter.cs
- UpdateRecord.cs
- SspiSecurityTokenProvider.cs
- TraceContext.cs
- WebBrowsableAttribute.cs
- RefreshEventArgs.cs
- OleDbReferenceCollection.cs
- DataGridViewAdvancedBorderStyle.cs
- Binding.cs
- ManifestResourceInfo.cs
- DLinqDataModelProvider.cs
- DesignerVerbCollection.cs
- TripleDESCryptoServiceProvider.cs
- CompositeScriptReference.cs
- ItemsChangedEventArgs.cs
- AdCreatedEventArgs.cs
- RowSpanVector.cs
- Message.cs
- userdatakeys.cs
- LogicalCallContext.cs
- EntityDataSourceUtil.cs
- TransformValueSerializer.cs
- Evaluator.cs
- ChineseLunisolarCalendar.cs
- ThreadStateException.cs
- DataServiceHost.cs
- MailMessage.cs
- XmlUtil.cs
- ListBoxChrome.cs
- Table.cs
- DesignerActionUIStateChangeEventArgs.cs
- PropertyMapper.cs
- WizardPanelChangingEventArgs.cs
- XmlWriterSettings.cs
- Transform3DGroup.cs
- ParameterModifier.cs
- SecurityTokenException.cs
- SetIterators.cs
- StreamReader.cs
- SharedPerformanceCounter.cs
- ListChangedEventArgs.cs
- OpCopier.cs
- ToolboxComponentsCreatingEventArgs.cs
- UseAttributeSetsAction.cs
- AppliedDeviceFiltersDialog.cs
- SpecialNameAttribute.cs
- DiffuseMaterial.cs
- ExpressionBuilderContext.cs
- ZoomPercentageConverter.cs
- HtmlInputFile.cs
- HttpApplicationFactory.cs
- QueryOpcode.cs
- PersistChildrenAttribute.cs
- DateTimeConstantAttribute.cs
- PreProcessInputEventArgs.cs
- HMACSHA1.cs
- OdbcParameter.cs
- BufferBuilder.cs
- KeyEvent.cs
- ProtocolsConfigurationHandler.cs
- Quaternion.cs