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
- IPPacketInformation.cs
- CodeTypeDeclarationCollection.cs
- SystemIcmpV4Statistics.cs
- InternalControlCollection.cs
- SecureUICommand.cs
- EditorZoneBase.cs
- DataContractSerializer.cs
- SettingsAttributeDictionary.cs
- DefaultValueAttribute.cs
- PerformanceCounterTraceRecord.cs
- ColorPalette.cs
- SuppressMergeCheckAttribute.cs
- PointLight.cs
- MachineSettingsSection.cs
- DomNameTable.cs
- GenericTextProperties.cs
- NotifyIcon.cs
- CompiledRegexRunnerFactory.cs
- EntityConnection.cs
- PropertyEmitterBase.cs
- smtppermission.cs
- BitSet.cs
- Panel.cs
- InfocardClientCredentials.cs
- ScriptResourceHandler.cs
- DefaultExpression.cs
- PropertyContainer.cs
- DataGridViewRowStateChangedEventArgs.cs
- GiveFeedbackEvent.cs
- AppDomainUnloadedException.cs
- MetadataSource.cs
- SerialStream.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- IntPtr.cs
- CodeSnippetExpression.cs
- SqlDependency.cs
- DiscoveryOperationContext.cs
- ResourcePermissionBaseEntry.cs
- TextElementAutomationPeer.cs
- XPathSelectionIterator.cs
- DoubleAnimationClockResource.cs
- HtmlShimManager.cs
- DataTableNewRowEvent.cs
- PropertyIdentifier.cs
- DocumentGridContextMenu.cs
- ClientScriptManagerWrapper.cs
- EventHandlerList.cs
- HostingPreferredMapPath.cs
- TemplateColumn.cs
- _BufferOffsetSize.cs
- FileCodeGroup.cs
- HttpDictionary.cs
- KeyInterop.cs
- StreamingContext.cs
- ConfigXmlDocument.cs
- HeaderCollection.cs
- Cell.cs
- AxDesigner.cs
- BasicHttpBinding.cs
- WorkflowPersistenceContext.cs
- DataGridTableCollection.cs
- RC2.cs
- PagedDataSource.cs
- ZoneIdentityPermission.cs
- CodeTryCatchFinallyStatement.cs
- DataColumnPropertyDescriptor.cs
- WebPartEventArgs.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- CompositeActivityDesigner.cs
- ToolStripItemCollection.cs
- Attribute.cs
- TextBox.cs
- Clause.cs
- RetrieveVirtualItemEventArgs.cs
- TreeBuilder.cs
- HtmlAnchor.cs
- GeometryHitTestResult.cs
- VisualTreeHelper.cs
- SqlMethods.cs
- CurrentTimeZone.cs
- AnnotationComponentChooser.cs
- SafeThreadHandle.cs
- XmlTextReaderImpl.cs
- DoubleLink.cs
- HiddenFieldPageStatePersister.cs
- XmlUtilWriter.cs
- RawTextInputReport.cs
- Animatable.cs
- BuiltInExpr.cs
- SQLBoolean.cs
- Instrumentation.cs
- CounterNameConverter.cs
- sitestring.cs
- DataColumnChangeEvent.cs
- XsltQilFactory.cs
- ImageDrawing.cs
- WebBrowserContainer.cs
- HashRepartitionEnumerator.cs
- SqlIdentifier.cs
- MailBnfHelper.cs