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
- RootBuilder.cs
- cookieexception.cs
- _HTTPDateParse.cs
- QilTypeChecker.cs
- SamlConditions.cs
- AdCreatedEventArgs.cs
- DependencyObjectProvider.cs
- XmlCDATASection.cs
- DataFormats.cs
- SerializerProvider.cs
- MaskDescriptors.cs
- StringInfo.cs
- ValidationErrorEventArgs.cs
- CompiledQueryCacheEntry.cs
- KoreanCalendar.cs
- Mutex.cs
- Cell.cs
- ChtmlImageAdapter.cs
- CultureMapper.cs
- OdbcConnectionString.cs
- DetailsViewPageEventArgs.cs
- StorageEntitySetMapping.cs
- WebPartCollection.cs
- EntityContainerEntitySet.cs
- MetadataStore.cs
- DesignerUtility.cs
- behaviorssection.cs
- ListSortDescriptionCollection.cs
- RoleBoolean.cs
- RenderDataDrawingContext.cs
- TextParaClient.cs
- FigureHelper.cs
- EtwProvider.cs
- ShaderRenderModeValidation.cs
- XmlMembersMapping.cs
- UserMapPath.cs
- Style.cs
- RelationshipDetailsCollection.cs
- ContentFileHelper.cs
- SmiContextFactory.cs
- ContextMenu.cs
- ChannelOptions.cs
- PageRanges.cs
- SchemaMapping.cs
- XmlSchemaComplexContent.cs
- ValidatorUtils.cs
- WebCategoryAttribute.cs
- EFTableProvider.cs
- DesignerGenericWebPart.cs
- CreateUserWizard.cs
- webproxy.cs
- Table.cs
- KeyFrames.cs
- HuffCodec.cs
- ClrProviderManifest.cs
- ListViewSelectEventArgs.cs
- BoundField.cs
- AspCompat.cs
- RichTextBox.cs
- HttpRequestCacheValidator.cs
- SHA512Managed.cs
- MemberHolder.cs
- SortExpressionBuilder.cs
- ProviderBase.cs
- FilteredReadOnlyMetadataCollection.cs
- UriSection.cs
- ComUdtElement.cs
- LoadItemsEventArgs.cs
- WindowsImpersonationContext.cs
- __TransparentProxy.cs
- XslNumber.cs
- PropertyNames.cs
- PositiveTimeSpanValidatorAttribute.cs
- TreeBuilder.cs
- Rect3D.cs
- ToolStripRendererSwitcher.cs
- XmlQueryContext.cs
- XAMLParseException.cs
- webclient.cs
- ObjectQueryProvider.cs
- GeneratedCodeAttribute.cs
- ValueType.cs
- HtmlTextArea.cs
- SchemaTypeEmitter.cs
- BufferedGraphicsManager.cs
- EnumValAlphaComparer.cs
- TextSelection.cs
- MetadataFile.cs
- xml.cs
- EventLogPermission.cs
- MatrixCamera.cs
- XmlNullResolver.cs
- TextRunTypographyProperties.cs
- COAUTHINFO.cs
- TemplateNameScope.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- XmlAtomicValue.cs
- Misc.cs
- HeaderUtility.cs
- HashHelper.cs