Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / System / Windows / Media3D / Generated / MeshGeometry3D.cs / 2 / MeshGeometry3D.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // This file was generated, please do not edit it directly. // // Please see [....]/default.aspx/Microsoft.Projects.Avalon/MilCodeGen.html for more information. // //--------------------------------------------------------------------------- using MS.Internal; using MS.Internal.Collections; using MS.Internal.PresentationCore; using MS.Utility; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.InteropServices; using System.Text; using System.Windows.Markup; using System.Windows.Media.Media3D.Converters; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using System.Security; using System.Security.Permissions; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; using System.Windows.Media.Imaging; // These types are aliased to match the unamanaged names used in interop using BOOL = System.UInt32; using WORD = System.UInt16; using Float = System.Single; namespace System.Windows.Media.Media3D { sealed partial class MeshGeometry3D : Geometry3D { #region Constructors //----------------------------------------------------- // // Constructors // //----------------------------------------------------- static MeshGeometry3D() { // We check our static default fields which are of type Freezable // to make sure that they are not mutable, otherwise we will throw // if these get touched by more than one thread in the lifetime // of your app. (Windows OS Bug #947272) // Debug.Assert(s_Positions == null || s_Positions.IsFrozen, "Detected context bound default value MeshGeometry3D.s_Positions (See OS Bug #947272)."); Debug.Assert(s_Normals == null || s_Normals.IsFrozen, "Detected context bound default value MeshGeometry3D.s_Normals (See OS Bug #947272)."); Debug.Assert(s_TextureCoordinates == null || s_TextureCoordinates.IsFrozen, "Detected context bound default value MeshGeometry3D.s_TextureCoordinates (See OS Bug #947272)."); Debug.Assert(s_TriangleIndices == null || s_TriangleIndices.IsFrozen, "Detected context bound default value MeshGeometry3D.s_TriangleIndices (See OS Bug #947272)."); } #endregion Constructors //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- #region Public Methods ////// Shadows inherited Clone() with a strongly typed /// version for convenience. /// public new MeshGeometry3D Clone() { return (MeshGeometry3D)base.Clone(); } ////// Shadows inherited CloneCurrentValue() with a strongly typed /// version for convenience. /// public new MeshGeometry3D CloneCurrentValue() { return (MeshGeometry3D)base.CloneCurrentValue(); } #endregion Public Methods //------------------------------------------------------ // // Public Properties // //------------------------------------------------------ private static void PositionsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MeshGeometry3D target = ((MeshGeometry3D) d); target.PropertyChanged(PositionsProperty); } private static void NormalsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MeshGeometry3D target = ((MeshGeometry3D) d); target.PropertyChanged(NormalsProperty); } private static void TextureCoordinatesPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MeshGeometry3D target = ((MeshGeometry3D) d); target.PropertyChanged(TextureCoordinatesProperty); } private static void TriangleIndicesPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MeshGeometry3D target = ((MeshGeometry3D) d); target.PropertyChanged(TriangleIndicesProperty); } #region Public Properties ////// Positions - Point3DCollection. Default value is new FreezableDefaultValueFactory(Point3DCollection.Empty). /// public Point3DCollection Positions { get { return (Point3DCollection) GetValue(PositionsProperty); } set { SetValueInternal(PositionsProperty, value); } } ////// Normals - Vector3DCollection. Default value is new FreezableDefaultValueFactory(Vector3DCollection.Empty). /// public Vector3DCollection Normals { get { return (Vector3DCollection) GetValue(NormalsProperty); } set { SetValueInternal(NormalsProperty, value); } } ////// TextureCoordinates - PointCollection. Default value is new FreezableDefaultValueFactory(PointCollection.Empty). /// public PointCollection TextureCoordinates { get { return (PointCollection) GetValue(TextureCoordinatesProperty); } set { SetValueInternal(TextureCoordinatesProperty, value); } } ////// TriangleIndices - Int32Collection. Default value is new FreezableDefaultValueFactory(Int32Collection.Empty). /// public Int32Collection TriangleIndices { get { return (Int32Collection) GetValue(TriangleIndicesProperty); } set { SetValueInternal(TriangleIndicesProperty, value); } } #endregion Public Properties //----------------------------------------------------- // // Protected Methods // //------------------------------------------------------ #region Protected Methods ////// Implementation of ///Freezable.CreateInstanceCore . ///The new Freezable. protected override Freezable CreateInstanceCore() { return new MeshGeometry3D(); } #endregion ProtectedMethods //----------------------------------------------------- // // Internal Methods // //----------------------------------------------------- #region Internal Methods ////// Critical: This code calls into an unsafe code block /// TreatAsSafe: This code does not return any critical data.It is ok to expose /// Channels are safe to call into and do not go cross domain and cross process /// [SecurityCritical,SecurityTreatAsSafe] internal override void UpdateResource(DUCE.Channel channel, bool skipOnChannelCheck) { // If we're told we can skip the channel check, then we must be on channel Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); if (skipOnChannelCheck || _duceResource.IsOnChannel(channel)) { base.UpdateResource(channel, skipOnChannelCheck); // Read values of properties into local variables Point3DCollection vPositions = Positions; Vector3DCollection vNormals = Normals; PointCollection vTextureCoordinates = TextureCoordinates; Int32Collection vTriangleIndices = TriangleIndices; Int32Collection vBlendColors = null; // Store the count of this resource's contained collections in local variables. int PositionsCount = (vPositions == null) ? 0 : vPositions.Count; int NormalsCount = (vNormals == null) ? 0 : vNormals.Count; int TextureCoordinatesCount = (vTextureCoordinates == null) ? 0 : vTextureCoordinates.Count; int TriangleIndicesCount = (vTriangleIndices == null) ? 0 : vTriangleIndices.Count; int BlendColorsCount = (vBlendColors == null) ? 0 : vBlendColors.Count; // Pack & send command packet DUCE.MILCMD_MESHGEOMETRY3D data; unsafe { data.Type = MILCMD.MilCmdMeshGeometry3D; data.Handle = _duceResource.GetHandle(channel); data.PositionsSize = (uint)(sizeof(MIL_3DPOINTF) * PositionsCount); data.NormalsSize = (uint)(sizeof(MIL_3DPOINTF) * NormalsCount); data.TextureCoordinatesSize = (uint)(sizeof(Point) * TextureCoordinatesCount); data.TriangleIndicesSize = (uint)(sizeof(Int32) * TriangleIndicesCount); data.BlendColorsSize = (uint)(sizeof(Int32) * BlendColorsCount); channel.BeginCommand( (byte*)&data, sizeof(DUCE.MILCMD_MESHGEOMETRY3D), (int)(data.PositionsSize + data.NormalsSize + data.TextureCoordinatesSize + data.TriangleIndicesSize + data.BlendColorsSize) ); // Copy this collection's elements (or their handles) to reserved data for(int i = 0; i < PositionsCount; i++) { MIL_3DPOINTF resource = CompositionResourceManager.Point3DToMIL_3DPOINTF(vPositions.Internal_GetItem(i)); channel.AppendCommandData( (byte*)&resource, sizeof(MIL_3DPOINTF) ); } // Copy this collection's elements (or their handles) to reserved data for(int i = 0; i < NormalsCount; i++) { MIL_3DPOINTF resource = CompositionResourceManager.Vector3DToMIL_3DPOINTF(vNormals.Internal_GetItem(i)); channel.AppendCommandData( (byte*)&resource, sizeof(MIL_3DPOINTF) ); } // Copy this collection's elements (or their handles) to reserved data for(int i = 0; i < TextureCoordinatesCount; i++) { Point resource = vTextureCoordinates.Internal_GetItem(i); channel.AppendCommandData( (byte*)&resource, sizeof(Point) ); } // Copy this collection's elements (or their handles) to reserved data for(int i = 0; i < TriangleIndicesCount; i++) { Int32 resource = vTriangleIndices.Internal_GetItem(i); channel.AppendCommandData( (byte*)&resource, sizeof(Int32) ); } channel.EndCommand(); } } } internal override DUCE.ResourceHandle AddRefOnChannelCore(DUCE.Channel channel) { if (_duceResource.CreateOrAddRefOnChannel(channel, System.Windows.Media.Composition.DUCE.ResourceType.TYPE_MESHGEOMETRY3D)) { AddRefOnChannelAnimations(channel); UpdateResource(channel, true /* skip "on channel" check - we already know that we're on channel */ ); } return _duceResource.GetHandle(channel); } internal override void ReleaseOnChannelCore(DUCE.Channel channel) { Debug.Assert(_duceResource.IsOnChannel(channel)); if (_duceResource.ReleaseOnChannel(channel)) { ReleaseOnChannelAnimations(channel); } } internal override DUCE.ResourceHandle GetHandleCore(DUCE.Channel channel) { // Note that we are in a lock here already. return _duceResource.GetHandle(channel); } internal override int GetChannelCountCore() { // must already be in composition lock here return _duceResource.GetChannelCount(); } internal override DUCE.Channel GetChannelCore(int index) { // Note that we are in a lock here already. return _duceResource.GetChannel(index); } #endregion Internal Methods //----------------------------------------------------- // // Internal Properties // //------------------------------------------------------ #region Internal Properties // // This property finds the correct initial size for the _effectiveValues store on the // current DependencyObject as a performance optimization // // This includes: // Positions // Normals // TextureCoordinates // TriangleIndices // internal override int EffectiveValuesInitialSize { get { return 4; } } #endregion Internal Properties //----------------------------------------------------- // // Dependency Properties // //------------------------------------------------------ #region Dependency Properties ////// The DependencyProperty for the MeshGeometry3D.Positions property. /// public static readonly DependencyProperty PositionsProperty = RegisterProperty("Positions", typeof(Point3DCollection), typeof(MeshGeometry3D), new FreezableDefaultValueFactory(Point3DCollection.Empty), new PropertyChangedCallback(PositionsPropertyChanged), null, /* isIndependentlyAnimated = */ false, /* coerceValueCallback */ null); ////// The DependencyProperty for the MeshGeometry3D.Normals property. /// public static readonly DependencyProperty NormalsProperty = RegisterProperty("Normals", typeof(Vector3DCollection), typeof(MeshGeometry3D), new FreezableDefaultValueFactory(Vector3DCollection.Empty), new PropertyChangedCallback(NormalsPropertyChanged), null, /* isIndependentlyAnimated = */ false, /* coerceValueCallback */ null); ////// The DependencyProperty for the MeshGeometry3D.TextureCoordinates property. /// public static readonly DependencyProperty TextureCoordinatesProperty = RegisterProperty("TextureCoordinates", typeof(PointCollection), typeof(MeshGeometry3D), new FreezableDefaultValueFactory(PointCollection.Empty), new PropertyChangedCallback(TextureCoordinatesPropertyChanged), null, /* isIndependentlyAnimated = */ false, /* coerceValueCallback */ null); ////// The DependencyProperty for the MeshGeometry3D.TriangleIndices property. /// public static readonly DependencyProperty TriangleIndicesProperty = RegisterProperty("TriangleIndices", typeof(Int32Collection), typeof(MeshGeometry3D), new FreezableDefaultValueFactory(Int32Collection.Empty), new PropertyChangedCallback(TriangleIndicesPropertyChanged), null, /* isIndependentlyAnimated = */ false, /* coerceValueCallback */ null); #endregion Dependency Properties //------------------------------------------------------ // // Internal Fields // //----------------------------------------------------- #region Internal Fields internal System.Windows.Media.Composition.DUCE.MultiChannelResource _duceResource = new System.Windows.Media.Composition.DUCE.MultiChannelResource(); internal static Point3DCollection s_Positions = Point3DCollection.Empty; internal static Vector3DCollection s_Normals = Vector3DCollection.Empty; internal static PointCollection s_TextureCoordinates = PointCollection.Empty; internal static Int32Collection s_TriangleIndices = Int32Collection.Empty; #endregion Internal 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
- xamlnodes.cs
- View.cs
- FullTextBreakpoint.cs
- ServiceMemoryGates.cs
- ShaperBuffers.cs
- EntitySetBaseCollection.cs
- SoapReflectionImporter.cs
- BmpBitmapDecoder.cs
- BufferedGraphicsManager.cs
- ScriptModule.cs
- IImplicitResourceProvider.cs
- DescendentsWalker.cs
- TextRange.cs
- ExtensionMethods.cs
- MinimizableAttributeTypeConverter.cs
- HijriCalendar.cs
- BasicHttpBindingCollectionElement.cs
- RightsManagementEncryptedStream.cs
- SqlClientFactory.cs
- GenericIdentity.cs
- RegionInfo.cs
- ArgumentOutOfRangeException.cs
- SoapFault.cs
- MaskedTextBox.cs
- BaseTemplatedMobileComponentEditor.cs
- ImmutableAssemblyCacheEntry.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- HtmlElementErrorEventArgs.cs
- LinkUtilities.cs
- InternalsVisibleToAttribute.cs
- PingReply.cs
- XmlSchemaDatatype.cs
- ImplicitInputBrush.cs
- OutputCache.cs
- EncryptedReference.cs
- Single.cs
- ToolStripSplitButton.cs
- OrderedDictionaryStateHelper.cs
- Utils.cs
- ReadContentAsBinaryHelper.cs
- ToggleProviderWrapper.cs
- WindowVisualStateTracker.cs
- ValidationSummary.cs
- EditorReuseAttribute.cs
- CreateUserWizardDesigner.cs
- XmlSchemaInfo.cs
- CqlIdentifiers.cs
- StyleSelector.cs
- StrokeFIndices.cs
- WSDualHttpSecurity.cs
- BordersPage.cs
- ClientConvert.cs
- PEFileReader.cs
- DataBindEngine.cs
- CollectionDataContractAttribute.cs
- LabelTarget.cs
- PropertyBuilder.cs
- SystemFonts.cs
- UnsafeNativeMethods.cs
- SystemInformation.cs
- FrameworkContentElementAutomationPeer.cs
- TokenFactoryBase.cs
- GenericTypeParameterBuilder.cs
- XmlAttributeCollection.cs
- PointCollection.cs
- XmlSchemaValidationException.cs
- OdbcUtils.cs
- BlurBitmapEffect.cs
- SQLConvert.cs
- SrgsGrammarCompiler.cs
- ExceptQueryOperator.cs
- MD5CryptoServiceProvider.cs
- ItemsControl.cs
- QilUnary.cs
- LinkConverter.cs
- SystemDropShadowChrome.cs
- CommandHelpers.cs
- Timeline.cs
- TableLayoutRowStyleCollection.cs
- EraserBehavior.cs
- SmtpClient.cs
- ExpressionPrinter.cs
- CodeAttributeArgumentCollection.cs
- SiteMembershipCondition.cs
- VerificationAttribute.cs
- ReaderWriterLockWrapper.cs
- PropertyEmitterBase.cs
- SmtpNegotiateAuthenticationModule.cs
- NamespaceQuery.cs
- WindowsSlider.cs
- InfoCardUIAgent.cs
- Intellisense.cs
- RouteCollection.cs
- AsnEncodedData.cs
- DeviceContext2.cs
- VirtualPathUtility.cs
- EntityDesignerUtils.cs
- UrlMappingCollection.cs
- FlowDocument.cs
- CodeDirectoryCompiler.cs