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
- QueueException.cs
- DeploymentSection.cs
- StringUtil.cs
- ExpandCollapsePattern.cs
- EntityConnectionStringBuilderItem.cs
- SmiConnection.cs
- SoapIncludeAttribute.cs
- DependencyObjectPropertyDescriptor.cs
- PlainXmlSerializer.cs
- JsonCollectionDataContract.cs
- ObjectItemAttributeAssemblyLoader.cs
- CopyNamespacesAction.cs
- SiteMapNode.cs
- HMACSHA512.cs
- SoapSchemaMember.cs
- oledbmetadatacolumnnames.cs
- MultiDataTrigger.cs
- DataTrigger.cs
- BaseTemplateCodeDomTreeGenerator.cs
- TdsEnums.cs
- ItemChangedEventArgs.cs
- GetWinFXPath.cs
- FrameworkTemplate.cs
- DesigntimeLicenseContextSerializer.cs
- Constraint.cs
- DefaultParameterValueAttribute.cs
- NameSpaceEvent.cs
- TypeInitializationException.cs
- input.cs
- StructuralCache.cs
- TypeListConverter.cs
- _AutoWebProxyScriptEngine.cs
- OleDbConnectionInternal.cs
- SettingsPropertyValue.cs
- DataGridComponentEditor.cs
- Vertex.cs
- InvalidDataException.cs
- SecurityTokenTypes.cs
- IMembershipProvider.cs
- SessionEndingEventArgs.cs
- DefaultCommandExtensionCallback.cs
- CompositionCommandSet.cs
- Stack.cs
- PerformanceCounterPermissionAttribute.cs
- Graph.cs
- LowerCaseStringConverter.cs
- FamilyTypeface.cs
- Tablet.cs
- SafeFileHandle.cs
- MatcherBuilder.cs
- ImageListDesigner.cs
- SiteMapDataSourceDesigner.cs
- ReflectionPermission.cs
- DataGridColumnCollection.cs
- UnsafeCollabNativeMethods.cs
- MouseGestureConverter.cs
- HtmlLink.cs
- ListenerConstants.cs
- Rotation3DAnimationBase.cs
- SqlDependencyListener.cs
- VariableExpressionConverter.cs
- ModelItemImpl.cs
- SqlError.cs
- WindowsStatusBar.cs
- LazyTextWriterCreator.cs
- DecoderExceptionFallback.cs
- DocumentPage.cs
- IndicCharClassifier.cs
- PopOutPanel.cs
- AnimationClock.cs
- CapabilitiesState.cs
- SessionStateModule.cs
- GlobalizationAssembly.cs
- CmsInterop.cs
- CssClassPropertyAttribute.cs
- MsmqReceiveHelper.cs
- safex509handles.cs
- PaperSource.cs
- RightsManagementPermission.cs
- UIElementHelper.cs
- RectangleConverter.cs
- PageParserFilter.cs
- Odbc32.cs
- MenuAutomationPeer.cs
- Collection.cs
- RuntimeConfigLKG.cs
- StylusOverProperty.cs
- Vector3DCollection.cs
- List.cs
- SByteConverter.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- DesignerCatalogPartChrome.cs
- DesignerInterfaces.cs
- WSFederationHttpSecurityMode.cs
- EnumUnknown.cs
- FastPropertyAccessor.cs
- SqlNodeAnnotation.cs
- RegexNode.cs
- SiteMapDataSource.cs
- NetMsmqSecurityMode.cs