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
- ProtocolsConfiguration.cs
- RowSpanVector.cs
- ExpressionConverter.cs
- ValidationRule.cs
- DataContractJsonSerializerOperationFormatter.cs
- ModelVisual3D.cs
- PackUriHelper.cs
- InputLanguageSource.cs
- LogicalExpr.cs
- Part.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- Util.cs
- ProcessingInstructionAction.cs
- WindowsGraphicsCacheManager.cs
- PeerApplicationLaunchInfo.cs
- FontStretch.cs
- CollectionsUtil.cs
- StreamReader.cs
- EventMappingSettingsCollection.cs
- BinaryUtilClasses.cs
- BufferedGraphicsManager.cs
- DocumentXmlWriter.cs
- StyleCollectionEditor.cs
- ChtmlTextWriter.cs
- Msec.cs
- XmlBoundElement.cs
- UnsafeNativeMethods.cs
- LocalBuilder.cs
- RegexCompilationInfo.cs
- DispatchChannelSink.cs
- DataTableMappingCollection.cs
- ContentPropertyAttribute.cs
- loginstatus.cs
- DataServiceRequest.cs
- ImageConverter.cs
- _AuthenticationState.cs
- ExpressionParser.cs
- XmlChoiceIdentifierAttribute.cs
- ServiceModelExtensionCollectionElement.cs
- HttpProtocolImporter.cs
- OdbcConnectionHandle.cs
- EntityDesignerUtils.cs
- SemanticBasicElement.cs
- XmlEventCache.cs
- EmptyImpersonationContext.cs
- VirtualizingStackPanel.cs
- QuaternionAnimation.cs
- RawStylusActions.cs
- SafeHandles.cs
- BadImageFormatException.cs
- Int32CAMarshaler.cs
- HealthMonitoringSectionHelper.cs
- PerfCounterSection.cs
- AddInProcess.cs
- XmlSchemaSubstitutionGroup.cs
- SQLBytesStorage.cs
- DataGridViewCellParsingEventArgs.cs
- NGCSerializerAsync.cs
- DatagridviewDisplayedBandsData.cs
- MailFileEditor.cs
- PipeSecurity.cs
- SqlConnectionString.cs
- ContextStaticAttribute.cs
- FontWeights.cs
- GridSplitterAutomationPeer.cs
- ReferenceConverter.cs
- StyleSelector.cs
- DiagnosticTrace.cs
- TimeSpanValidatorAttribute.cs
- DataTableReaderListener.cs
- SHA384Cng.cs
- ErrorWrapper.cs
- printdlgexmarshaler.cs
- ResourcesChangeInfo.cs
- XPathConvert.cs
- RoleManagerSection.cs
- XmlSchemaAttributeGroup.cs
- PageParserFilter.cs
- Switch.cs
- EntityObject.cs
- DataMisalignedException.cs
- TemplateControl.cs
- RequestStatusBarUpdateEventArgs.cs
- AnnotationComponentManager.cs
- ObjectTypeMapping.cs
- ContentType.cs
- MimeTypeAttribute.cs
- SQLResource.cs
- HitTestWithPointDrawingContextWalker.cs
- PrimitiveXmlSerializers.cs
- MembershipUser.cs
- CodeRemoveEventStatement.cs
- CodeDomSerializerBase.cs
- SoapEnumAttribute.cs
- VirtualizedContainerService.cs
- WebPartConnectionsConnectVerb.cs
- CodeVariableDeclarationStatement.cs
- MenuItemStyleCollection.cs
- WindowsRichEdit.cs
- UriTemplate.cs