Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- Comparer.cs
- MultilineStringEditor.cs
- DataGridItemCollection.cs
- PasswordTextNavigator.cs
- WeakEventManager.cs
- CancellationTokenRegistration.cs
- RemoteHelper.cs
- WindowsAuthenticationModule.cs
- PropagatorResult.cs
- InArgument.cs
- _SingleItemRequestCache.cs
- ActivityExecutionContextCollection.cs
- Matrix3DConverter.cs
- QilIterator.cs
- DataColumn.cs
- TextEvent.cs
- LowerCaseStringConverter.cs
- DataGridRowDetailsEventArgs.cs
- StdValidatorsAndConverters.cs
- HeaderedItemsControl.cs
- Rijndael.cs
- PersonalizationStateQuery.cs
- RawStylusInput.cs
- IPipelineRuntime.cs
- SplashScreen.cs
- PaginationProgressEventArgs.cs
- SafeNativeMethods.cs
- GCHandleCookieTable.cs
- DesignerTransactionCloseEvent.cs
- DataListItemCollection.cs
- OdbcCommand.cs
- DefaultAssemblyResolver.cs
- CommandSet.cs
- RijndaelCryptoServiceProvider.cs
- _PooledStream.cs
- TextEditorTyping.cs
- QilValidationVisitor.cs
- EditorZoneBase.cs
- TypeValidationEventArgs.cs
- RuntimeVariableList.cs
- SqlDataSourceSelectingEventArgs.cs
- CompensationExtension.cs
- Figure.cs
- CompilerState.cs
- QilInvokeLateBound.cs
- EntityRecordInfo.cs
- PageCache.cs
- EdmComplexPropertyAttribute.cs
- RoleManagerModule.cs
- ColorConvertedBitmap.cs
- MatrixIndependentAnimationStorage.cs
- PrefixQName.cs
- DataGridComboBoxColumn.cs
- TrustLevel.cs
- srgsitem.cs
- UpdateExpressionVisitor.cs
- OptimisticConcurrencyException.cs
- GetImportFileNameRequest.cs
- OpenFileDialog.cs
- ConditionCollection.cs
- SQLMoney.cs
- EmptyCollection.cs
- AssertSection.cs
- XmlAttribute.cs
- DrawListViewItemEventArgs.cs
- RepeatEnumerable.cs
- HtmlHead.cs
- CachedBitmap.cs
- EmptyEnumerator.cs
- BrowsableAttribute.cs
- SplitterPanel.cs
- LambdaCompiler.ControlFlow.cs
- SqlTypeSystemProvider.cs
- XmlnsDictionary.cs
- HandlerFactoryWrapper.cs
- Setter.cs
- BamlLocalizableResource.cs
- UTF7Encoding.cs
- ToolStripLocationCancelEventArgs.cs
- PropertyDescriptorGridEntry.cs
- XsdBuildProvider.cs
- DataGridViewElement.cs
- ScaleTransform.cs
- CompilationUnit.cs
- Matrix3DConverter.cs
- SqlNotificationEventArgs.cs
- NavigatorOutput.cs
- SqlDataSourceDesigner.cs
- BookmarkEventArgs.cs
- HtmlInputPassword.cs
- Base64Decoder.cs
- XmlSubtreeReader.cs
- SchemaTableColumn.cs
- RenderingEventArgs.cs
- TypeUtil.cs
- OdbcRowUpdatingEvent.cs
- EntityKeyElement.cs
- TextWriter.cs
- Matrix3DStack.cs
- InputBindingCollection.cs