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
- Context.cs
- RuntimeConfigLKG.cs
- XPathBuilder.cs
- ImpersonationOption.cs
- FigureParaClient.cs
- DataGridItemAutomationPeer.cs
- ReservationCollection.cs
- X509ServiceCertificateAuthentication.cs
- CopyNamespacesAction.cs
- XmlElementCollection.cs
- _HeaderInfoTable.cs
- DurableServiceAttribute.cs
- MetadataPropertyAttribute.cs
- UpdateCommandGenerator.cs
- DependencyPropertyAttribute.cs
- SchemaHelper.cs
- CommandHelpers.cs
- SizeLimitedCache.cs
- HttpPostedFileBase.cs
- OrderByLifter.cs
- ExpressionNode.cs
- _BaseOverlappedAsyncResult.cs
- DebugView.cs
- DocumentCollection.cs
- RequestCacheValidator.cs
- TrackingStringDictionary.cs
- RowVisual.cs
- ControlParser.cs
- PhysicalFontFamily.cs
- OpenFileDialog.cs
- Size3D.cs
- RIPEMD160Managed.cs
- AnnotationHelper.cs
- _SpnDictionary.cs
- ManipulationInertiaStartingEventArgs.cs
- NativeCppClassAttribute.cs
- ProfilePropertySettings.cs
- ChannelTraceRecord.cs
- SeekableReadStream.cs
- RepeatBehaviorConverter.cs
- DBDataPermissionAttribute.cs
- RemotingSurrogateSelector.cs
- EmptyQuery.cs
- ControlAdapter.cs
- KeyValueSerializer.cs
- CharacterMetricsDictionary.cs
- DataGridViewBand.cs
- MimeBasePart.cs
- AQNBuilder.cs
- GridViewRowPresenter.cs
- DataSourceControl.cs
- AudienceUriMode.cs
- HttpResponseHeader.cs
- RequestStatusBarUpdateEventArgs.cs
- ParameterCollection.cs
- CodeCastExpression.cs
- ReflectionPermission.cs
- EncoderReplacementFallback.cs
- securestring.cs
- CapabilitiesState.cs
- ImageCodecInfo.cs
- Group.cs
- ProcessModelInfo.cs
- WebConvert.cs
- SettingsPropertyValueCollection.cs
- Filter.cs
- EncodingConverter.cs
- InlineObject.cs
- ZoneIdentityPermission.cs
- WebConvert.cs
- SqlConnectionHelper.cs
- SecUtil.cs
- ISAPIApplicationHost.cs
- BufferModesCollection.cs
- InputChannelAcceptor.cs
- XmlAggregates.cs
- XmlSchemaAttributeGroupRef.cs
- SectionVisual.cs
- _NegoStream.cs
- DesignBinding.cs
- SqlNodeAnnotation.cs
- AdapterUtil.cs
- PrincipalPermission.cs
- LogicalTreeHelper.cs
- ToolStripItem.cs
- DataPointer.cs
- ClientConfigurationSystem.cs
- SiteMapPath.cs
- AudioLevelUpdatedEventArgs.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- UIElementIsland.cs
- KeyboardDevice.cs
- SqlClientPermission.cs
- KnownTypes.cs
- PartialCachingAttribute.cs
- ConnectionPoint.cs
- CacheDependency.cs
- DataGridViewCellStyleConverter.cs
- WebPartsPersonalization.cs
- ModuleElement.cs