Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / Media3D / MaterialGroup.cs / 1 / MaterialGroup.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Material group // //--------------------------------------------------------------------------- using System; using System.Collections; using System.Diagnostics; using System.Windows; using System.Windows.Media; using System.Windows.Media.Media3D; using System.Windows.Markup; using MS.Internal; using MS.Internal.Media3D; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media.Media3D { ////// Material group /// [ContentProperty("Children")] public sealed partial class MaterialGroup : Material { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors ////// Default constructor. /// public MaterialGroup() {} #endregion Constructors //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- #region Public Methods #endregion Public Methods //------------------------------------------------------ // // Internal Methods // //------------------------------------------------------ #region Internal Methods // If a child changes or is added/removed to this, // that will fire changed which will mark the GeometryModel3D // containing this as DirtyForPreCompute which will // cause PreCompute() to be called on us. // // Thus, we don't need to override OnChanged() and update // _requiresRealization here in MaterialGroup. internal override bool PreCompute() { _requiresRealization = false; MaterialCollection children = Children; if (children != null) { int count = children.Count; for (int i = 0; i < count; i++) { // Can't early exit on first 'true' because PreCompute // does work that's necessary for every Material that // has text in it _requiresRealization |= children.Internal_GetItem(i).PreCompute(); } } return _requiresRealization; } internal override void UpdateRealizations( RealizationContext ctx, ref Rect bounds ) { Debug.Assert(_requiresRealization); MaterialCollection children = Children; if (children != null) { int count = children.Count; for (int i = 0; i < count; i++) { Material material = children.Internal_GetItem(i); if (material.RequiresRealization) { material.UpdateRealizations(ctx, ref bounds); } } } } #endregion Internal Methods //----------------------------------------------------- // // Internal Properties // //------------------------------------------------------ #region Internal Properties internal override bool RequiresRealization { get { return _requiresRealization; } } #endregion Internal Properties //----------------------------------------------------- // // Private Fields // //----------------------------------------------------- #region Private Fields private bool _requiresRealization = false; #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Material group // //--------------------------------------------------------------------------- using System; using System.Collections; using System.Diagnostics; using System.Windows; using System.Windows.Media; using System.Windows.Media.Media3D; using System.Windows.Markup; using MS.Internal; using MS.Internal.Media3D; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media.Media3D { ////// Material group /// [ContentProperty("Children")] public sealed partial class MaterialGroup : Material { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors ////// Default constructor. /// public MaterialGroup() {} #endregion Constructors //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- #region Public Methods #endregion Public Methods //------------------------------------------------------ // // Internal Methods // //------------------------------------------------------ #region Internal Methods // If a child changes or is added/removed to this, // that will fire changed which will mark the GeometryModel3D // containing this as DirtyForPreCompute which will // cause PreCompute() to be called on us. // // Thus, we don't need to override OnChanged() and update // _requiresRealization here in MaterialGroup. internal override bool PreCompute() { _requiresRealization = false; MaterialCollection children = Children; if (children != null) { int count = children.Count; for (int i = 0; i < count; i++) { // Can't early exit on first 'true' because PreCompute // does work that's necessary for every Material that // has text in it _requiresRealization |= children.Internal_GetItem(i).PreCompute(); } } return _requiresRealization; } internal override void UpdateRealizations( RealizationContext ctx, ref Rect bounds ) { Debug.Assert(_requiresRealization); MaterialCollection children = Children; if (children != null) { int count = children.Count; for (int i = 0; i < count; i++) { Material material = children.Internal_GetItem(i); if (material.RequiresRealization) { material.UpdateRealizations(ctx, ref bounds); } } } } #endregion Internal Methods //----------------------------------------------------- // // Internal Properties // //------------------------------------------------------ #region Internal Properties internal override bool RequiresRealization { get { return _requiresRealization; } } #endregion Internal Properties //----------------------------------------------------- // // Private Fields // //----------------------------------------------------- #region Private Fields private bool _requiresRealization = false; #endregion Private Fields } } // 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
- WindowsSlider.cs
- Helpers.cs
- DataSpaceManager.cs
- EntityDataSourceChangedEventArgs.cs
- ValidatingCollection.cs
- wgx_sdk_version.cs
- _ShellExpression.cs
- WorkflowViewElement.cs
- ServerProtocol.cs
- Models.cs
- followingquery.cs
- followingsibling.cs
- RoleGroupCollectionEditor.cs
- CodeEventReferenceExpression.cs
- StandardCommands.cs
- JsonFormatGeneratorStatics.cs
- ImageClickEventArgs.cs
- DataSysAttribute.cs
- PointCollectionConverter.cs
- DispatcherFrame.cs
- PaperSource.cs
- XmlSchemaAttribute.cs
- AutomationInteropProvider.cs
- AttributedMetaModel.cs
- NavigateEvent.cs
- BamlWriter.cs
- DocumentGridPage.cs
- Vector3D.cs
- TaskFormBase.cs
- PersonalizableAttribute.cs
- Margins.cs
- SqlFunctions.cs
- InkCanvas.cs
- NativeWindow.cs
- ToolBar.cs
- PathSegmentCollection.cs
- CompilerErrorCollection.cs
- COM2AboutBoxPropertyDescriptor.cs
- UnsafeNativeMethods.cs
- WindowsImpersonationContext.cs
- HtmlEncodedRawTextWriter.cs
- UiaCoreTypesApi.cs
- GridLength.cs
- OutputCacheModule.cs
- UidManager.cs
- BufferedWebEventProvider.cs
- OutputCacheProfileCollection.cs
- EncoderReplacementFallback.cs
- TakeQueryOptionExpression.cs
- PreloadedPackages.cs
- EdmError.cs
- DataSet.cs
- ServiceRoute.cs
- MimeWriter.cs
- Opcode.cs
- CodeIdentifier.cs
- PopOutPanel.cs
- AssemblyAttributesGoHere.cs
- PtsHost.cs
- QueryFunctions.cs
- DecimalKeyFrameCollection.cs
- ComponentCodeDomSerializer.cs
- DefaultPropertyAttribute.cs
- GlyphRunDrawing.cs
- ObjectListItemCollection.cs
- MembershipSection.cs
- ProgressBar.cs
- DrawingImage.cs
- ReleaseInstanceMode.cs
- KerberosReceiverSecurityToken.cs
- ContentPosition.cs
- MulticastNotSupportedException.cs
- CodeSubDirectoriesCollection.cs
- LinearGradientBrush.cs
- ExecutionContext.cs
- ContractMapping.cs
- XamlSerializer.cs
- DesignConnection.cs
- Int32.cs
- XmlTextWriter.cs
- ProxyFragment.cs
- JoinGraph.cs
- DocumentViewerConstants.cs
- ToolStripPanel.cs
- QueryOutputWriter.cs
- BuilderPropertyEntry.cs
- RTTrackingProfile.cs
- SafeViewOfFileHandle.cs
- ScrollContentPresenter.cs
- ServerIdentity.cs
- ProxyElement.cs
- UnsafeCollabNativeMethods.cs
- MetadataCollection.cs
- IconBitmapDecoder.cs
- DispatcherObject.cs
- PerformanceCounterPermission.cs
- ComNativeDescriptor.cs
- EventEntry.cs
- BinaryKeyIdentifierClause.cs
- ApplicationTrust.cs