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
- X509ChainPolicy.cs
- EntityDataSourceReferenceGroup.cs
- _NegoState.cs
- _NetRes.cs
- GridLengthConverter.cs
- UnknownBitmapEncoder.cs
- BamlMapTable.cs
- _CookieModule.cs
- FragmentQueryProcessor.cs
- CompiledIdentityConstraint.cs
- PromptBuilder.cs
- WinEventQueueItem.cs
- AssemblyInfo.cs
- CommandDevice.cs
- ModelTreeManager.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- ToolStripArrowRenderEventArgs.cs
- SHA384Managed.cs
- ApplicationServiceManager.cs
- ProviderConnectionPointCollection.cs
- DictionaryGlobals.cs
- TableLayoutPanel.cs
- ActivationArguments.cs
- DataViewListener.cs
- ButtonBaseDesigner.cs
- XmlWriterDelegator.cs
- FormView.cs
- AnimationLayer.cs
- WebWorkflowRole.cs
- Graphics.cs
- TextPointerBase.cs
- DocumentSchemaValidator.cs
- OdbcEnvironment.cs
- PrintPreviewDialog.cs
- Timer.cs
- SID.cs
- AttributeConverter.cs
- NavigationHelper.cs
- DbConnectionPoolCounters.cs
- CodePageEncoding.cs
- Convert.cs
- WarningException.cs
- DbQueryCommandTree.cs
- RemotingConfigParser.cs
- FormViewPagerRow.cs
- EntityExpressionVisitor.cs
- Gdiplus.cs
- TreeNodeClickEventArgs.cs
- SqlEnums.cs
- TextModifierScope.cs
- IsolatedStorage.cs
- AppDomainManager.cs
- RegexWriter.cs
- NavigationPropertyEmitter.cs
- LicenseProviderAttribute.cs
- Stroke2.cs
- ProfileGroupSettings.cs
- TokenDescriptor.cs
- RemoteCryptoRsaServiceProvider.cs
- LocalizableResourceBuilder.cs
- PerformanceCountersBase.cs
- Viewport3DVisual.cs
- FileDialog.cs
- XmlSchemaType.cs
- SEHException.cs
- ItemsControl.cs
- StorageConditionPropertyMapping.cs
- HttpValueCollection.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- Freezable.cs
- IOThreadTimer.cs
- RestHandler.cs
- XPathNavigator.cs
- ApplicationInfo.cs
- TextBlockAutomationPeer.cs
- ToolStripPanelSelectionGlyph.cs
- altserialization.cs
- MailBnfHelper.cs
- WebProxyScriptElement.cs
- ScriptHandlerFactory.cs
- XmlNode.cs
- XmlQuerySequence.cs
- BitmapData.cs
- WorkflowDesignerMessageFilter.cs
- PeerNearMe.cs
- XmlSchemaAnnotation.cs
- ChangePassword.cs
- MultiSelectRootGridEntry.cs
- contentDescriptor.cs
- BitmapMetadataBlob.cs
- UrlMapping.cs
- ServiceKnownTypeAttribute.cs
- GeneralTransformGroup.cs
- TypeReference.cs
- RtfToXamlLexer.cs
- CodeSubDirectory.cs
- NamedObject.cs
- Tokenizer.cs
- TemplatedWizardStep.cs
- BamlBinaryWriter.cs