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
- PathFigureCollection.cs
- Base64Decoder.cs
- ToolStrip.cs
- GregorianCalendar.cs
- Group.cs
- NameValuePair.cs
- DefaultParameterValueAttribute.cs
- UriTemplateMatchException.cs
- MetadataProperty.cs
- WebPartChrome.cs
- Visual3D.cs
- TransformerInfoCollection.cs
- FileRegion.cs
- SwitchLevelAttribute.cs
- SystemFonts.cs
- GenericUriParser.cs
- FrugalList.cs
- DesignTimeParseData.cs
- SerializerProvider.cs
- FunctionImportMapping.cs
- StateChangeEvent.cs
- SoapSchemaExporter.cs
- PlanCompiler.cs
- InputLanguageProfileNotifySink.cs
- DoubleStorage.cs
- EventMappingSettings.cs
- MouseCaptureWithinProperty.cs
- localization.cs
- PermissionSetEnumerator.cs
- HostingPreferredMapPath.cs
- DetailsViewInsertEventArgs.cs
- TextBoxBase.cs
- ExpressionParser.cs
- SmiRecordBuffer.cs
- CodeDefaultValueExpression.cs
- ACE.cs
- OracleCommandSet.cs
- Paragraph.cs
- TakeQueryOptionExpression.cs
- ChangePasswordAutoFormat.cs
- ExceptQueryOperator.cs
- ScriptingRoleServiceSection.cs
- DurationConverter.cs
- Matrix3DValueSerializer.cs
- MobileUserControl.cs
- IssuanceLicense.cs
- SqlRetyper.cs
- SelectionWordBreaker.cs
- MemberRelationshipService.cs
- DecimalAnimation.cs
- UIElementAutomationPeer.cs
- MessageBuilder.cs
- DateTimeOffset.cs
- Component.cs
- OdbcPermission.cs
- BackgroundFormatInfo.cs
- XmlDataSource.cs
- BitmapEffectInputData.cs
- ThemeableAttribute.cs
- ImmutableObjectAttribute.cs
- SettingsProperty.cs
- ContainerParagraph.cs
- UnmanagedMemoryStream.cs
- Single.cs
- Point3DAnimation.cs
- Parsers.cs
- ComplusEndpointConfigContainer.cs
- SqlUserDefinedAggregateAttribute.cs
- CompositeKey.cs
- WindowsNonControl.cs
- Switch.cs
- XmlElement.cs
- CAGDesigner.cs
- DecimalStorage.cs
- MruCache.cs
- Crc32.cs
- TextPatternIdentifiers.cs
- CalendarDay.cs
- ItemsControlAutomationPeer.cs
- SelectionChangedEventArgs.cs
- EdmType.cs
- MethodBuilderInstantiation.cs
- smtpconnection.cs
- SourceSwitch.cs
- ObjectItemAssemblyLoader.cs
- RuntimeEnvironment.cs
- RegexGroup.cs
- SendAgentStatusRequest.cs
- BindStream.cs
- PocoPropertyAccessorStrategy.cs
- ToolStripItemEventArgs.cs
- ILGenerator.cs
- SqlDataSourceCommandEventArgs.cs
- InvalidCastException.cs
- UniformGrid.cs
- SourceFileInfo.cs
- Ref.cs
- WizardPanelChangingEventArgs.cs
- HtmlElementEventArgs.cs
- BoolLiteral.cs