Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- TypeConverterValueSerializer.cs
- SelectedGridItemChangedEvent.cs
- PartialCachingControl.cs
- KnownTypeDataContractResolver.cs
- Parser.cs
- WebConfigurationFileMap.cs
- SqlBuilder.cs
- WebBrowserSiteBase.cs
- BrowsableAttribute.cs
- XmlElementAttribute.cs
- CompareInfo.cs
- ClassicBorderDecorator.cs
- NegotiationTokenAuthenticatorStateCache.cs
- GridViewColumn.cs
- EdmEntityTypeAttribute.cs
- SubstitutionResponseElement.cs
- DbProviderFactory.cs
- WebPageTraceListener.cs
- XmlElementAttribute.cs
- DependentList.cs
- XmlDocumentFragment.cs
- Stream.cs
- DataRecordInternal.cs
- SyndicationSerializer.cs
- mansign.cs
- Misc.cs
- TypeListConverter.cs
- URLIdentityPermission.cs
- QueuePathEditor.cs
- CodeAttributeArgumentCollection.cs
- Empty.cs
- SqlCacheDependencyDatabase.cs
- GlobalProxySelection.cs
- AutomationPatternInfo.cs
- XmlDataLoader.cs
- ComboBoxDesigner.cs
- PrivilegeNotHeldException.cs
- x509utils.cs
- SqlRecordBuffer.cs
- JournalEntry.cs
- DisableDpiAwarenessAttribute.cs
- ResourcePermissionBase.cs
- NativeMethods.cs
- XmlSchemaAppInfo.cs
- MulticastIPAddressInformationCollection.cs
- SoapException.cs
- XPathCompileException.cs
- Inflater.cs
- CompoundFileReference.cs
- SignedInfo.cs
- MouseWheelEventArgs.cs
- ExecutionEngineException.cs
- ProxyWebPartManager.cs
- TypeConverterHelper.cs
- Bezier.cs
- DesignTimeParseData.cs
- MergeFailedEvent.cs
- GACIdentityPermission.cs
- ByteConverter.cs
- HttpCacheVaryByContentEncodings.cs
- WindowExtensionMethods.cs
- OdbcFactory.cs
- XamlPointCollectionSerializer.cs
- PipelineComponent.cs
- MouseEvent.cs
- LoginName.cs
- HitTestFilterBehavior.cs
- IntPtr.cs
- Graphics.cs
- EditingContext.cs
- LocalizableAttribute.cs
- HtmlContainerControl.cs
- AssemblyBuilderData.cs
- TargetException.cs
- SyndicationDeserializer.cs
- EndOfStreamException.cs
- DragDrop.cs
- EntityDataSourceReferenceGroup.cs
- CriticalFinalizerObject.cs
- LogReservationCollection.cs
- VisualBasicSettingsHandler.cs
- InputScope.cs
- HtmlElementErrorEventArgs.cs
- PropertyStore.cs
- HwndPanningFeedback.cs
- Soap12ProtocolImporter.cs
- CodeCatchClauseCollection.cs
- CodeMemberField.cs
- RNGCryptoServiceProvider.cs
- DoubleAnimationUsingKeyFrames.cs
- ListSourceHelper.cs
- WebPartConnectionsCloseVerb.cs
- XXXOnTypeBuilderInstantiation.cs
- ErrorCodes.cs
- ParseHttpDate.cs
- RangeValuePattern.cs
- IdentityReference.cs
- TypeUnloadedException.cs
- GridErrorDlg.cs
- DataStreamFromComStream.cs