Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ReadOnlyHierarchicalDataSource.cs
- StylusPointPropertyId.cs
- MasterPageParser.cs
- EditorPart.cs
- DrawingCollection.cs
- FormViewDeleteEventArgs.cs
- ReflectionUtil.cs
- OpCopier.cs
- ManagementClass.cs
- ReadWriteObjectLock.cs
- StyleXamlTreeBuilder.cs
- TraceSwitch.cs
- FormattedText.cs
- AsyncOperationManager.cs
- DetailsViewUpdateEventArgs.cs
- Stream.cs
- ZipIOFileItemStream.cs
- HuffmanTree.cs
- ZipPackagePart.cs
- SignatureHelper.cs
- VectorCollection.cs
- XmlSchemaException.cs
- CompoundFileReference.cs
- WebBrowserBase.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- Int32CollectionConverter.cs
- BitmapFrameEncode.cs
- MonikerUtility.cs
- XmlLangPropertyAttribute.cs
- UInt32Converter.cs
- PeerNodeAddress.cs
- HwndSourceParameters.cs
- mediaclock.cs
- Shape.cs
- SafeLocalAllocation.cs
- FacetValueContainer.cs
- SiteIdentityPermission.cs
- DecoderReplacementFallback.cs
- WebSysDescriptionAttribute.cs
- WebPartDisplayModeCollection.cs
- DynamicDocumentPaginator.cs
- FontStretchConverter.cs
- AddInServer.cs
- ErasingStroke.cs
- ConsumerConnectionPoint.cs
- ResizeGrip.cs
- SHA512Managed.cs
- TrustManagerMoreInformation.cs
- ReferencedCollectionType.cs
- ExpressionReplacer.cs
- SqlInternalConnection.cs
- Attribute.cs
- SimpleTextLine.cs
- TypeConverter.cs
- VSWCFServiceContractGenerator.cs
- DPCustomTypeDescriptor.cs
- MultipleViewProviderWrapper.cs
- MobileErrorInfo.cs
- FormsAuthentication.cs
- DataGridViewButtonColumn.cs
- LinearGradientBrush.cs
- EventOpcode.cs
- ProcessModelSection.cs
- Rect3DValueSerializer.cs
- XmlSchemas.cs
- PolicyStatement.cs
- ReservationCollection.cs
- HostedImpersonationContext.cs
- ExceptionRoutedEventArgs.cs
- HttpHeaderCollection.cs
- securestring.cs
- ColorPalette.cs
- HwndKeyboardInputProvider.cs
- ConfigurationSettings.cs
- PageContent.cs
- RepeaterItemCollection.cs
- Geometry3D.cs
- QuaternionRotation3D.cs
- IndexOutOfRangeException.cs
- ResourceCategoryAttribute.cs
- RenderData.cs
- DebugView.cs
- SecurityDocument.cs
- WSDualHttpSecurityElement.cs
- XmlHelper.cs
- TypeReference.cs
- RsaKeyIdentifierClause.cs
- IBuiltInEvidence.cs
- WmpBitmapDecoder.cs
- DataControlHelper.cs
- DropShadowBitmapEffect.cs
- SmtpNetworkElement.cs
- StatusBarAutomationPeer.cs
- BamlReader.cs
- AttributeProviderAttribute.cs
- DataControlPagerLinkButton.cs
- ApplicationProxyInternal.cs
- BooleanStorage.cs
- ComAdminInterfaces.cs
- WaitHandleCannotBeOpenedException.cs