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
- ActivityCodeDomSerializer.cs
- DetailsView.cs
- SystemColors.cs
- BaseTemplateCodeDomTreeGenerator.cs
- filewebresponse.cs
- SQLConvert.cs
- AlignmentXValidation.cs
- EmbeddedMailObject.cs
- StyleModeStack.cs
- OperationResponse.cs
- BuildManagerHost.cs
- ServiceMoniker.cs
- SchemaImporter.cs
- SignedXmlDebugLog.cs
- ResourceReferenceExpressionConverter.cs
- ByteConverter.cs
- ReliabilityContractAttribute.cs
- WebPartCatalogCloseVerb.cs
- ResourceWriter.cs
- TypeGeneratedEventArgs.cs
- DataGridViewCell.cs
- DocumentSchemaValidator.cs
- FullTrustAssembliesSection.cs
- XamlWriter.cs
- xmlformatgeneratorstatics.cs
- CheckPair.cs
- ExtensionFile.cs
- EarlyBoundInfo.cs
- NewExpression.cs
- CompilerState.cs
- OleDbPermission.cs
- Attribute.cs
- Compiler.cs
- DataListAutoFormat.cs
- DetailsViewPageEventArgs.cs
- StreamAsIStream.cs
- CodeDelegateCreateExpression.cs
- Connector.cs
- ListSurrogate.cs
- TlsnegoTokenProvider.cs
- WebServiceTypeData.cs
- ManagementDateTime.cs
- GlobalizationSection.cs
- RegexInterpreter.cs
- ActivationArguments.cs
- CommandDevice.cs
- InternalBufferManager.cs
- BinaryConverter.cs
- RootProfilePropertySettingsCollection.cs
- TextBoxBase.cs
- TextCompositionManager.cs
- CardSpaceShim.cs
- CodeCommentStatement.cs
- TextChange.cs
- CharacterMetrics.cs
- SQLMembershipProvider.cs
- BitmapEffect.cs
- MembershipValidatePasswordEventArgs.cs
- TreeViewTemplateSelector.cs
- WebServicesInteroperability.cs
- UnhandledExceptionEventArgs.cs
- AllMembershipCondition.cs
- HttpWebRequestElement.cs
- ResolveMatches11.cs
- GraphicsState.cs
- TraceUtility.cs
- ReflectionUtil.cs
- SingleTagSectionHandler.cs
- ActivityBindForm.cs
- ContainerFilterService.cs
- SchemaContext.cs
- XmlUTF8TextReader.cs
- Attributes.cs
- UnknownBitmapDecoder.cs
- UnmanagedMemoryStreamWrapper.cs
- Frame.cs
- StringResourceManager.cs
- NavigationEventArgs.cs
- FastEncoder.cs
- DBNull.cs
- RegexInterpreter.cs
- MarshalByValueComponent.cs
- DrawingVisualDrawingContext.cs
- PersonalizablePropertyEntry.cs
- TextElementEnumerator.cs
- ContainerParagraph.cs
- SqlServer2KCompatibilityCheck.cs
- PopupRootAutomationPeer.cs
- RelationshipDetailsCollection.cs
- Empty.cs
- ToolStripItemClickedEventArgs.cs
- DefaultSerializationProviderAttribute.cs
- Msmq.cs
- AssemblyHash.cs
- MailWriter.cs
- WindowsStatusBar.cs
- XmlSignatureManifest.cs
- TimeSpanConverter.cs
- WS2007HttpBindingCollectionElement.cs
- EventLogQuery.cs