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
- CustomCategoryAttribute.cs
- HttpValueCollection.cs
- CollectionChangedEventManager.cs
- TaskResultSetter.cs
- GeneralTransform.cs
- DataGridViewUtilities.cs
- RsaSecurityToken.cs
- DataRowView.cs
- XmlCollation.cs
- DependsOnAttribute.cs
- CellIdBoolean.cs
- CaseInsensitiveComparer.cs
- XPathChildIterator.cs
- SelectionItemProviderWrapper.cs
- Interlocked.cs
- CollectionEditor.cs
- ServiceChannelFactory.cs
- ChannelCredentials.cs
- BitmapEffectDrawingContextWalker.cs
- TableCellCollection.cs
- TemplateInstanceAttribute.cs
- ArgumentNullException.cs
- IdnElement.cs
- RectIndependentAnimationStorage.cs
- Focus.cs
- ArglessEventHandlerProxy.cs
- DataSpaceManager.cs
- NavigationCommands.cs
- EntityViewContainer.cs
- XPathNavigatorKeyComparer.cs
- QuotedStringFormatReader.cs
- IPAddress.cs
- NodeLabelEditEvent.cs
- LayoutEditorPart.cs
- AnnotationResource.cs
- DetailsViewModeEventArgs.cs
- MissingManifestResourceException.cs
- FunctionImportMapping.cs
- FixedSOMFixedBlock.cs
- EntityRecordInfo.cs
- BindingExpression.cs
- EncryptedKeyIdentifierClause.cs
- XmlDeclaration.cs
- XmlElementList.cs
- DesignSurfaceCollection.cs
- SmiContext.cs
- mediaeventargs.cs
- ProfilePropertySettings.cs
- LinqDataSourceStatusEventArgs.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- SqlPersonalizationProvider.cs
- SimpleTypeResolver.cs
- ParallelLoopState.cs
- DependencyPropertyKind.cs
- HashStream.cs
- ToolStripOverflow.cs
- RenderTargetBitmap.cs
- RoleManagerModule.cs
- TriggerActionCollection.cs
- PathFigure.cs
- MinimizableAttributeTypeConverter.cs
- TypeReference.cs
- DbException.cs
- LinkButton.cs
- OuterGlowBitmapEffect.cs
- EntitySqlQueryCacheEntry.cs
- CodeExpressionCollection.cs
- PropertyInfoSet.cs
- AnimationLayer.cs
- TypeListConverter.cs
- DbSetClause.cs
- XmlILModule.cs
- CharacterShapingProperties.cs
- __ConsoleStream.cs
- ContentElement.cs
- HandledMouseEvent.cs
- CombinedHttpChannel.cs
- DecimalAnimationUsingKeyFrames.cs
- VBCodeProvider.cs
- DBNull.cs
- ObjectDataSourceEventArgs.cs
- AudioDeviceOut.cs
- Globals.cs
- RotateTransform.cs
- DesignerInterfaces.cs
- ResolveNameEventArgs.cs
- MarkupCompilePass2.cs
- FileEnumerator.cs
- ImageMap.cs
- DetailsViewAutoFormat.cs
- OpCopier.cs
- CodeEventReferenceExpression.cs
- Trace.cs
- MapPathBasedVirtualPathProvider.cs
- IconBitmapDecoder.cs
- AstTree.cs
- HttpProfileGroupBase.cs
- MouseGestureValueSerializer.cs
- Util.cs
- MetadataProperty.cs