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
- RenderDataDrawingContext.cs
- SqlXmlStorage.cs
- TemplatedMailWebEventProvider.cs
- BatchWriter.cs
- Relationship.cs
- SpecularMaterial.cs
- ellipse.cs
- IxmlLineInfo.cs
- TransformDescriptor.cs
- UnauthorizedWebPart.cs
- ConnectionManagementElement.cs
- RelationshipEnd.cs
- ContentPosition.cs
- RawStylusActions.cs
- TabletDevice.cs
- PageFunction.cs
- SystemIPAddressInformation.cs
- RouteData.cs
- SynchronizationFilter.cs
- CellRelation.cs
- LogWriteRestartAreaAsyncResult.cs
- RoleManagerModule.cs
- AssemblyCache.cs
- CriticalHandle.cs
- securestring.cs
- ConversionValidationRule.cs
- Facet.cs
- ArrayExtension.cs
- ConfigurationSectionCollection.cs
- SecurityCriticalDataForSet.cs
- TileBrush.cs
- OutputCacheSettingsSection.cs
- StringConverter.cs
- SoapEnumAttribute.cs
- FastEncoderWindow.cs
- ObjectItemAssemblyLoader.cs
- TypeDescriptor.cs
- InProcStateClientManager.cs
- COM2Properties.cs
- SystemColors.cs
- SoapReflectionImporter.cs
- HScrollBar.cs
- SerializationFieldInfo.cs
- RawStylusSystemGestureInputReport.cs
- XmlSchemaParticle.cs
- QilScopedVisitor.cs
- CustomErrorsSectionWrapper.cs
- CanonicalizationDriver.cs
- Compensation.cs
- CodeMemberEvent.cs
- TextMarkerSource.cs
- PaperSize.cs
- PartialCachingControl.cs
- _BaseOverlappedAsyncResult.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- ServiceHostingEnvironment.cs
- UniformGrid.cs
- ImageInfo.cs
- SHA1.cs
- DBConcurrencyException.cs
- objectquery_tresulttype.cs
- StringBuilder.cs
- BatchParser.cs
- DataGridViewCell.cs
- ThumbAutomationPeer.cs
- InputLanguageProfileNotifySink.cs
- DayRenderEvent.cs
- MediaContextNotificationWindow.cs
- ParallelActivityDesigner.cs
- CorrelationManager.cs
- NamedPermissionSet.cs
- BinaryFormatterSinks.cs
- HwndSource.cs
- GridViewColumnCollectionChangedEventArgs.cs
- StylusDownEventArgs.cs
- DefaultEventAttribute.cs
- CLSCompliantAttribute.cs
- LexicalChunk.cs
- KeyEvent.cs
- TableDetailsCollection.cs
- ConstructorNeedsTagAttribute.cs
- UpdateTranslator.cs
- TypeResolver.cs
- CqlIdentifiers.cs
- WSTrustFeb2005.cs
- GetPageNumberCompletedEventArgs.cs
- OrthographicCamera.cs
- MaterialGroup.cs
- ByteConverter.cs
- columnmapkeybuilder.cs
- BitmapEffectInputData.cs
- Listbox.cs
- PenContexts.cs
- OciLobLocator.cs
- ServiceDeploymentInfo.cs
- PathSegment.cs
- login.cs
- IntegerFacetDescriptionElement.cs
- UserPreferenceChangingEventArgs.cs
- Material.cs