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
- MultipartContentParser.cs
- EventLogger.cs
- UpdatePanelTrigger.cs
- ListView.cs
- Menu.cs
- RoleGroup.cs
- LeaseManager.cs
- OrderedHashRepartitionEnumerator.cs
- PluralizationServiceUtil.cs
- TdsParserHelperClasses.cs
- StylusPointPropertyInfo.cs
- SourceChangedEventArgs.cs
- XmlQuerySequence.cs
- ColumnPropertiesGroup.cs
- TraceEventCache.cs
- XmlDigitalSignatureProcessor.cs
- EntityCollection.cs
- SizeAnimation.cs
- BooleanAnimationBase.cs
- XmlAttributeCollection.cs
- DependencyPropertyChangedEventArgs.cs
- BuildProvider.cs
- WebPartActionVerb.cs
- MetadataWorkspace.cs
- HandlerMappingMemo.cs
- BindingManagerDataErrorEventArgs.cs
- SqlDataSource.cs
- PerformanceCounterPermissionEntry.cs
- XmlDomTextWriter.cs
- TabControl.cs
- GenericAuthenticationEventArgs.cs
- PopupRootAutomationPeer.cs
- SmiTypedGetterSetter.cs
- ExpressionBindings.cs
- Expressions.cs
- RenderTargetBitmap.cs
- SafeEventLogWriteHandle.cs
- CommunicationObjectManager.cs
- ScriptingProfileServiceSection.cs
- ZipIOCentralDirectoryBlock.cs
- Point4D.cs
- TextBox.cs
- Triangle.cs
- CultureSpecificStringDictionary.cs
- XmlAnyAttributeAttribute.cs
- AuthenticationConfig.cs
- PropertyGroupDescription.cs
- DesignerView.xaml.cs
- TransformPattern.cs
- ListControlConvertEventArgs.cs
- UIPropertyMetadata.cs
- CompilerInfo.cs
- httpapplicationstate.cs
- AttributeProviderAttribute.cs
- DataSourceHelper.cs
- X509Chain.cs
- DesignerTransactionCloseEvent.cs
- DocumentReference.cs
- TdsParser.cs
- ConfigXmlText.cs
- SqlNodeAnnotations.cs
- DbMetaDataCollectionNames.cs
- DbDataRecord.cs
- ResourceKey.cs
- ToolboxItemImageConverter.cs
- OrderingInfo.cs
- BitmapEffectCollection.cs
- ClientTargetSection.cs
- DataGridViewTopLeftHeaderCell.cs
- ChangePasswordAutoFormat.cs
- CodeCatchClause.cs
- RowUpdatedEventArgs.cs
- PeerName.cs
- ObjectContext.cs
- DecoderFallback.cs
- WebPartUtil.cs
- CatalogZoneAutoFormat.cs
- TextEditorSpelling.cs
- FixedHighlight.cs
- BuilderElements.cs
- WriteStateInfoBase.cs
- XmlFileEditor.cs
- ButtonBaseAutomationPeer.cs
- Dump.cs
- Calendar.cs
- CodePageUtils.cs
- InstanceLockedException.cs
- EdmComplexPropertyAttribute.cs
- XmlSerializerVersionAttribute.cs
- InputLanguageManager.cs
- XmlDataDocument.cs
- RoleManagerEventArgs.cs
- ConcurrentBag.cs
- EncodingDataItem.cs
- EasingKeyFrames.cs
- UTF32Encoding.cs
- DefaultIfEmptyQueryOperator.cs
- References.cs
- FormViewModeEventArgs.cs
- DbSetClause.cs