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
- CollectionTraceRecord.cs
- FieldToken.cs
- SqlGatherProducedAliases.cs
- FixUp.cs
- RegexParser.cs
- ScalarOps.cs
- TypeToken.cs
- FieldAccessException.cs
- UserPreferenceChangedEventArgs.cs
- Errors.cs
- DelegateSerializationHolder.cs
- CLSCompliantAttribute.cs
- LicenseManager.cs
- XmlSchemaDatatype.cs
- HttpCapabilitiesBase.cs
- ExpandSegmentCollection.cs
- ProcessHostMapPath.cs
- Collection.cs
- SelectionItemProviderWrapper.cs
- HtmlInputButton.cs
- DataSetUtil.cs
- DrawingContextDrawingContextWalker.cs
- FrameworkContentElement.cs
- DataGridViewColumnCollection.cs
- TransformValueSerializer.cs
- ManagementEventWatcher.cs
- DbTransaction.cs
- FileDocument.cs
- DefaultPropertyAttribute.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- IResourceProvider.cs
- FixedSOMTableCell.cs
- FormConverter.cs
- Dynamic.cs
- QueryLifecycle.cs
- XmlUrlResolver.cs
- OverflowException.cs
- UIElement.cs
- ToolStripStatusLabel.cs
- LogManagementAsyncResult.cs
- ToolStripPanelCell.cs
- ObjectDataSourceMethodEventArgs.cs
- ProfessionalColorTable.cs
- WindowsListViewGroupSubsetLink.cs
- ReferencedType.cs
- PropertyGridCommands.cs
- ResourcePermissionBaseEntry.cs
- PaginationProgressEventArgs.cs
- TraceData.cs
- SystemIPv6InterfaceProperties.cs
- sqlnorm.cs
- ProfileGroupSettings.cs
- ValidationSummary.cs
- DataServiceResponse.cs
- OfTypeExpression.cs
- Restrictions.cs
- Stackframe.cs
- WindowPattern.cs
- XmlSerializationReader.cs
- NavigationCommands.cs
- ListViewContainer.cs
- XLinq.cs
- XmlSchemaInfo.cs
- MeshGeometry3D.cs
- RenderTargetBitmap.cs
- ScriptingAuthenticationServiceSection.cs
- BeginStoryboard.cs
- CachedPathData.cs
- SiteOfOriginContainer.cs
- MethodCallTranslator.cs
- PropertyChangedEventArgs.cs
- bindurihelper.cs
- SystemWebSectionGroup.cs
- BinaryUtilClasses.cs
- DataGridViewAdvancedBorderStyle.cs
- ProcessInfo.cs
- ListManagerBindingsCollection.cs
- ChangeNode.cs
- DataBindingHandlerAttribute.cs
- DateTimePicker.cs
- Debugger.cs
- ProcessThreadCollection.cs
- DbConnectionPoolGroupProviderInfo.cs
- ContextActivityUtils.cs
- WindowsProgressbar.cs
- DataGridViewCheckBoxColumn.cs
- BinaryOperationBinder.cs
- DefaultTraceListener.cs
- StatusInfoItem.cs
- PerformanceCounterPermission.cs
- COM2ICategorizePropertiesHandler.cs
- Viewport3DVisual.cs
- ServerValidateEventArgs.cs
- CharAnimationBase.cs
- TextPenaltyModule.cs
- MediaScriptCommandRoutedEventArgs.cs
- PipeConnection.cs
- HandlerMappingMemo.cs
- DataServiceProcessingPipelineEventArgs.cs
- StructuredType.cs