当前位置: 首页>>代码示例>>C#>>正文


C# DUCE.SendCommand方法代码示例

本文整理汇总了C#中System.Windows.Media.Composition.DUCE.SendCommand方法的典型用法代码示例。如果您正苦于以下问题:C# DUCE.SendCommand方法的具体用法?C# DUCE.SendCommand怎么用?C# DUCE.SendCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Media.Composition.DUCE的用法示例。


在下文中一共展示了DUCE.SendCommand方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateResourceCore

        protected override void UpdateResourceCore(DUCE.Channel channel) 
        {
            Debug.Assert(_duceResource.IsOnChannel(channel)); 
            DependencyObject dobj = ((DependencyObject) _dependencyObject.Target); 

            // The dependency object was GCed, nothing to do here 
            if (dobj == null)
            {
                return;
            } 

            Quaternion tempValue = (Quaternion)dobj.GetValue(_dependencyProperty); 
 
            DUCE.MILCMD_QUATERNIONRESOURCE data;
            data.Type = MILCMD.MilCmdQuaternionResource; 
            data.Handle = _duceResource.GetHandle(channel);
            data.Value = CompositionResourceManager.QuaternionToMilQuaternionF(tempValue);

            unsafe 
            {
                channel.SendCommand( 
                    (byte*)&data, 
                    sizeof(DUCE.MILCMD_QUATERNIONRESOURCE));
            } 
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:25,代码来源:QuaternionIndependentAnimationStorage.cs

示例2: UpdateResourceCore

        protected override void UpdateResourceCore(DUCE.Channel channel)
        {
            Debug.Assert(_duceResource.IsOnChannel(channel));
            DependencyObject dobj = ((DependencyObject) _dependencyObject.Target);

            // The dependency object was GCed, nothing to do here
            if (dobj == null)
            {
                return;
            }

            Double tempValue = (Double)dobj.GetValue(_dependencyProperty);

            DUCE.MILCMD_DOUBLERESOURCE data;
            data.Type = MILCMD.MilCmdDoubleResource;
            data.Handle = _duceResource.GetHandle(channel);
            data.Value = tempValue;

            unsafe
            {
                channel.SendCommand(
                    (byte*)&data,
                    sizeof(DUCE.MILCMD_DOUBLERESOURCE));
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:25,代码来源:DoubleIndependentAnimationStorage.cs

示例3: UpdateBitmapSourceResource

        internal override void UpdateBitmapSourceResource(DUCE.Channel channel, bool skipOnChannelCheck)
        {
            //
            // If we're in BitmapSource mode, then just defer to the BitmapSource
            // implementation.
            //
            if (_actLikeSimpleBitmap)
            {
                base.UpdateBitmapSourceResource(channel, skipOnChannelCheck);
                return;
            }
            
            // We override this method because we use a different resource type
            // than our base class does.  This probably suggests that the base
            // class should not presume the resource type, but it currently
            // does.  The base class uses TYPE_BITMAPSOURCE resources, and we
            // use TYPE_DOUBLEBUFFEREDBITMAP resources.

            // 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))
            {
                DUCE.MILCMD_DOUBLEBUFFEREDBITMAP command;
                command.Type = MILCMD.MilCmdDoubleBufferedBitmap;
                command.Handle = _duceResource.GetHandle(channel);
                unsafe
                {
                    command.SwDoubleBufferedBitmap = (UInt64) _pDoubleBufferedBitmap.DangerousGetHandle().ToPointer();
                }
                command.UseBackBuffer = channel.IsSynchronous ? 1u : 0u;

                //
                // We need to ensure that this object stays alive while traveling over the channel
                // so we'll AddRef it here, and simply take over the reference on the other side.
                //
                UnsafeNativeMethods.MILUnknown.AddRef(_pDoubleBufferedBitmap);
                
                unsafe
                {
                    channel.SendCommand(
                        (byte*)&command,
                        sizeof(DUCE.MILCMD_DOUBLEBUFFEREDBITMAP),
                        false /* sendInSeparateBatch */
                        );
                }
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:48,代码来源:WriteableBitmap.cs

示例4: UpdateResource

        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
                Transform vTransform = Transform;
                Transform vRelativeTransform = RelativeTransform;
                BitmapCache vBitmapCache = BitmapCache;
                Visual vInternalTarget = InternalTarget;

                // Obtain handles for properties that implement DUCE.IResource
                DUCE.ResourceHandle hTransform;
                if (vTransform == null ||
                    Object.ReferenceEquals(vTransform, Transform.Identity)
                    )
                {
                    hTransform = DUCE.ResourceHandle.Null;
                }
                else
                {
                    hTransform = ((DUCE.IResource)vTransform).GetHandle(channel);
                }
                DUCE.ResourceHandle hRelativeTransform;
                if (vRelativeTransform == null ||
                    Object.ReferenceEquals(vRelativeTransform, Transform.Identity)
                    )
                {
                    hRelativeTransform = DUCE.ResourceHandle.Null;
                }
                else
                {
                    hRelativeTransform = ((DUCE.IResource)vRelativeTransform).GetHandle(channel);
                }
                DUCE.ResourceHandle hBitmapCache = vBitmapCache != null ? ((DUCE.IResource)vBitmapCache).GetHandle(channel) : DUCE.ResourceHandle.Null;

                // Obtain handles for properties that implement DUCE.IResource
                DUCE.ResourceHandle  hInternalTarget = vInternalTarget != null ? ((DUCE.IResource)vInternalTarget).GetHandle(channel) : DUCE.ResourceHandle.Null;

                // Obtain handles for animated properties
                DUCE.ResourceHandle hOpacityAnimations = GetAnimationResourceHandle(OpacityProperty, channel);

                // Pack & send command packet
                DUCE.MILCMD_BITMAPCACHEBRUSH data;
                unsafe
                {
                    data.Type = MILCMD.MilCmdBitmapCacheBrush;
                    data.Handle = _duceResource.GetHandle(channel);
                    if (hOpacityAnimations.IsNull)
                    {
                        data.Opacity = Opacity;
                    }
                    data.hOpacityAnimations = hOpacityAnimations;
                    data.hTransform = hTransform;
                    data.hRelativeTransform = hRelativeTransform;
                    data.hBitmapCache = hBitmapCache;
                    data.hInternalTarget = hInternalTarget;

                    // Send packed command structure
                    channel.SendCommand(
                        (byte*)&data,
                        sizeof(DUCE.MILCMD_BITMAPCACHEBRUSH));
                }
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:69,代码来源:BitmapCacheBrush.cs

示例5: UpdateResource

        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
                Transform vTransform = Transform;
                Transform vRelativeTransform = RelativeTransform;

                // Obtain handles for properties that implement DUCE.IResource
                DUCE.ResourceHandle hTransform;
                if (vTransform == null ||
                    Object.ReferenceEquals(vTransform, Transform.Identity)
                    )
                {
                    hTransform = DUCE.ResourceHandle.Null;
                }
                else
                {
                    hTransform = ((DUCE.IResource)vTransform).GetHandle(channel);
                }
                DUCE.ResourceHandle hRelativeTransform;
                if (vRelativeTransform == null ||
                    Object.ReferenceEquals(vRelativeTransform, Transform.Identity)
                    )
                {
                    hRelativeTransform = DUCE.ResourceHandle.Null;
                }
                else
                {
                    hRelativeTransform = ((DUCE.IResource)vRelativeTransform).GetHandle(channel);
                }

                // Obtain handles for animated properties
                DUCE.ResourceHandle hOpacityAnimations = GetAnimationResourceHandle(OpacityProperty, channel);
                DUCE.ResourceHandle hColorAnimations = GetAnimationResourceHandle(ColorProperty, channel);

                // Pack & send command packet
                DUCE.MILCMD_SOLIDCOLORBRUSH data;
                unsafe
                {
                    data.Type = MILCMD.MilCmdSolidColorBrush;
                    data.Handle = _duceResource.GetHandle(channel);
                    if (hOpacityAnimations.IsNull)
                    {
                        data.Opacity = Opacity;
                    }
                    data.hOpacityAnimations = hOpacityAnimations;
                    data.hTransform = hTransform;
                    data.hRelativeTransform = hRelativeTransform;
                    if (hColorAnimations.IsNull)
                    {
                        data.Color = CompositionResourceManager.ColorToMilColorF(Color);
                    }
                    data.hColorAnimations = hColorAnimations;

                    // Send packed command structure
                    channel.SendCommand(
                        (byte*)&data,
                        sizeof(DUCE.MILCMD_SOLIDCOLORBRUSH));
                }
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:67,代码来源:SolidColorBrush.cs

示例6: UpdateResource

        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
                Transform3D vTransform = Transform;

                // Obtain handles for properties that implement DUCE.IResource
                DUCE.ResourceHandle hTransform;
                if (vTransform == null ||
                    Object.ReferenceEquals(vTransform, Transform3D.Identity)
                    )
                {
                    hTransform = DUCE.ResourceHandle.Null;
                }
                else
                {
                    hTransform = ((DUCE.IResource)vTransform).GetHandle(channel);
                }

                // Obtain handles for animated properties
                DUCE.ResourceHandle hColorAnimations = GetAnimationResourceHandle(ColorProperty, channel);
                DUCE.ResourceHandle hDirectionAnimations = GetAnimationResourceHandle(DirectionProperty, channel);

                // Pack & send command packet
                DUCE.MILCMD_DIRECTIONALLIGHT data;
                unsafe
                {
                    data.Type = MILCMD.MilCmdDirectionalLight;
                    data.Handle = _duceResource.GetHandle(channel);
                    data.htransform = hTransform;
                    if (hColorAnimations.IsNull)
                    {
                        data.color = CompositionResourceManager.ColorToMilColorF(Color);
                    }
                    data.hColorAnimations = hColorAnimations;
                    if (hDirectionAnimations.IsNull)
                    {
                        data.direction = CompositionResourceManager.Vector3DToMilPoint3F(Direction);
                    }
                    data.hDirectionAnimations = hDirectionAnimations;

                    // Send packed command structure
                    channel.SendCommand(
                        (byte*)&data,
                        sizeof(DUCE.MILCMD_DIRECTIONALLIGHT));
                }
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:54,代码来源:DirectionalLight.cs

示例7: UpdateResource

        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);

                bool isSynchronous = channel.IsSynchronous;

                DUCE.MILCMD_D3DIMAGE data;
                unsafe
                {
                    data.Type = MILCMD.MilCmdD3DImage;
                    data.Handle = _duceResource.GetHandle(channel);
                    if (_pInteropDeviceBitmap != null)
                    {
                        UnsafeNativeMethods.MILUnknown.AddRef(_pInteropDeviceBitmap);
                        
                        data.pInteropDeviceBitmap = (ulong)_pInteropDeviceBitmap.DangerousGetHandle().ToPointer();
                    }
                    else
                    {
                        data.pInteropDeviceBitmap = 0;
                    }
                    
                    data.pSoftwareBitmap = 0;

                    if (isSynchronous)
                    {
                        _softwareCopy = CopyBackBuffer();
                        
                        if (_softwareCopy != null)
                        {
                            UnsafeNativeMethods.MILUnknown.AddRef(_softwareCopy.WicSourceHandle);
                            
                            data.pSoftwareBitmap = (ulong)_softwareCopy.WicSourceHandle.DangerousGetHandle().ToPointer();
                        }
                    }

                    // Send packed command structure
                    channel.SendCommand(
                        (byte*)&data,
                        sizeof(DUCE.MILCMD_D3DIMAGE),
                        false /* sendInSeparateBatch */
                        );
                }

                // Presents only happen on the async channel so don't let RTB flip this bit
                if (!isSynchronous)
                {
                    _waitingForUpdateResourceBecauseBitmapChanged = false;
                }
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:56,代码来源:D3DImage.cs

示例8: UpdateResource

        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
                Brush vBrush = Brush;
                Pen vPen = Pen;
                Geometry vGeometry = Geometry;

                // Obtain handles for properties that implement DUCE.IResource
                DUCE.ResourceHandle hBrush = vBrush != null ? ((DUCE.IResource)vBrush).GetHandle(channel) : DUCE.ResourceHandle.Null;
                DUCE.ResourceHandle hPen = vPen != null ? ((DUCE.IResource)vPen).GetHandle(channel) : DUCE.ResourceHandle.Null;
                DUCE.ResourceHandle hGeometry = vGeometry != null ? ((DUCE.IResource)vGeometry).GetHandle(channel) : DUCE.ResourceHandle.Null;

                // Pack & send command packet
                DUCE.MILCMD_GEOMETRYDRAWING data;
                unsafe
                {
                    data.Type = MILCMD.MilCmdGeometryDrawing;
                    data.Handle = _duceResource.GetHandle(channel);
                    data.hBrush = hBrush;
                    data.hPen = hPen;
                    data.hGeometry = hGeometry;

                    // Send packed command structure
                    channel.SendCommand(
                        (byte*)&data,
                        sizeof(DUCE.MILCMD_GEOMETRYDRAWING));
                }
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:36,代码来源:GeometryDrawing.cs

示例9: UpdateResource

        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
                Brush vBrush = Brush;

                // Obtain handles for properties that implement DUCE.IResource
                DUCE.ResourceHandle hBrush = vBrush != null ? ((DUCE.IResource)vBrush).GetHandle(channel) : DUCE.ResourceHandle.Null;

                // Pack & send command packet
                DUCE.MILCMD_EMISSIVEMATERIAL data;
                unsafe
                {
                    data.Type = MILCMD.MilCmdEmissiveMaterial;
                    data.Handle = _duceResource.GetHandle(channel);
                    data.color = CompositionResourceManager.ColorToMilColorF(Color);
                    data.hbrush = hBrush;

                    // Send packed command structure
                    channel.SendCommand(
                        (byte*)&data,
                        sizeof(DUCE.MILCMD_EMISSIVEMATERIAL));
                }
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:31,代码来源:EmissiveMaterial.cs

示例10: UpdateResource

        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
                ImageSource vImageSource = ImageSource; 

                // Obtain handles for properties that implement DUCE.IResource
                DUCE.ResourceHandle hImageSource = vImageSource != null ? ((DUCE.IResource)vImageSource).GetHandle(channel) : DUCE.ResourceHandle.Null;
 
                // Obtain handles for animated properties
                DUCE.ResourceHandle hRectAnimations = GetAnimationResourceHandle(RectProperty, channel); 
 
                // Pack & send command packet
                DUCE.MILCMD_IMAGEDRAWING data; 
                unsafe
                {
                    data.Type = MILCMD.MilCmdImageDrawing;
                    data.Handle = _duceResource.GetHandle(channel); 
                    data.hImageSource = hImageSource;
                    if (hRectAnimations.IsNull) 
                    { 
                        data.Rect = Rect;
                    } 
                    data.hRectAnimations = hRectAnimations;

                    // Send packed command structure
                    channel.SendCommand( 
                        (byte*)&data,
                        sizeof(DUCE.MILCMD_IMAGEDRAWING)); 
                } 
            }
        } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:38,代码来源:ImageDrawing.cs

示例11: UpdateResource

        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);

                // Obtain handles for animated properties
                DUCE.ResourceHandle hAngleXAnimations = GetAnimationResourceHandle(AngleXProperty, channel);
                DUCE.ResourceHandle hAngleYAnimations = GetAnimationResourceHandle(AngleYProperty, channel);
                DUCE.ResourceHandle hCenterXAnimations = GetAnimationResourceHandle(CenterXProperty, channel);
                DUCE.ResourceHandle hCenterYAnimations = GetAnimationResourceHandle(CenterYProperty, channel);

                // Pack & send command packet
                DUCE.MILCMD_SKEWTRANSFORM data;
                unsafe
                {
                    data.Type = MILCMD.MilCmdSkewTransform;
                    data.Handle = _duceResource.GetHandle(channel);
                    if (hAngleXAnimations.IsNull)
                    {
                        data.AngleX = AngleX;
                    }
                    data.hAngleXAnimations = hAngleXAnimations;
                    if (hAngleYAnimations.IsNull)
                    {
                        data.AngleY = AngleY;
                    }
                    data.hAngleYAnimations = hAngleYAnimations;
                    if (hCenterXAnimations.IsNull)
                    {
                        data.CenterX = CenterX;
                    }
                    data.hCenterXAnimations = hCenterXAnimations;
                    if (hCenterYAnimations.IsNull)
                    {
                        data.CenterY = CenterY;
                    }
                    data.hCenterYAnimations = hCenterYAnimations;

                    // Send packed command structure
                    channel.SendCommand(
                        (byte*)&data,
                        sizeof(DUCE.MILCMD_SKEWTRANSFORM));
                }
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:49,代码来源:SkewTransform.cs

示例12: UpdateResource

        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);

                // Obtain handles for animated properties
                DUCE.ResourceHandle hMatrixAnimations = GetAnimationResourceHandle(MatrixProperty, channel);

                // Pack & send command packet
                DUCE.MILCMD_MATRIXTRANSFORM data;
                unsafe
                {
                    data.Type = MILCMD.MilCmdMatrixTransform;
                    data.Handle = _duceResource.GetHandle(channel);
                    if (hMatrixAnimations.IsNull)
                    {
                        data.Matrix = CompositionResourceManager.MatrixToMilMatrix3x2D(Matrix);
                    }
                    data.hMatrixAnimations = hMatrixAnimations;

                    // Send packed command structure
                    channel.SendCommand(
                        (byte*)&data,
                        sizeof(DUCE.MILCMD_MATRIXTRANSFORM));
                }
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:31,代码来源:MatrixTransform.cs

示例13: UpdateResource

        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
                Transform3D vTransform = Transform; 

                // Obtain handles for properties that implement DUCE.IResource
                DUCE.ResourceHandle hTransform;
                if (vTransform == null || 
                    Object.ReferenceEquals(vTransform, Transform3D.Identity)
                    ) 
                { 
                    hTransform = DUCE.ResourceHandle.Null;
                } 
                else
                {
                    hTransform = ((DUCE.IResource)vTransform).GetHandle(channel);
                } 

                // Pack & send command packet 
                DUCE.MILCMD_MATRIXCAMERA data; 
                unsafe
                { 
                    data.Type = MILCMD.MilCmdMatrixCamera;
                    data.Handle = _duceResource.GetHandle(channel);
                    data.htransform = hTransform;
                    data.viewMatrix = CompositionResourceManager.Matrix3DToD3DMATRIX(ViewMatrix); 
                    data.projectionMatrix = CompositionResourceManager.Matrix3DToD3DMATRIX(ProjectionMatrix);
 
                    // Send packed command structure 
                    channel.SendCommand(
                        (byte*)&data, 
                        sizeof(DUCE.MILCMD_MATRIXCAMERA));
                }
            }
        } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:42,代码来源:MatrixCamera.cs

示例14: UpdateResource

        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
                Drawing vDrawing = Drawing;

                // Obtain handles for properties that implement DUCE.IResource
                DUCE.ResourceHandle hDrawing = vDrawing != null ? ((DUCE.IResource)vDrawing).GetHandle(channel) : DUCE.ResourceHandle.Null;

                // Pack & send command packet
                DUCE.MILCMD_DRAWINGIMAGE data;
                unsafe
                {
                    data.Type = MILCMD.MilCmdDrawingImage;
                    data.Handle = _duceResource.GetHandle(channel);
                    data.hDrawing = hDrawing;

                    // Send packed command structure
                    channel.SendCommand(
                        (byte*)&data,
                        sizeof(DUCE.MILCMD_DRAWINGIMAGE));
                }
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:30,代码来源:DrawingImage.cs

示例15: UpdateResource

        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
                Transform3D vTransform = Transform; 

                // Obtain handles for properties that implement DUCE.IResource 
                DUCE.ResourceHandle hTransform; 
                if (vTransform == null ||
                    Object.ReferenceEquals(vTransform, Transform3D.Identity) 
                    )
                {
                    hTransform = DUCE.ResourceHandle.Null;
                } 
                else
                { 
                    hTransform = ((DUCE.IResource)vTransform).GetHandle(channel); 
                }
 
                // Obtain handles for animated properties
                DUCE.ResourceHandle hColorAnimations = GetAnimationResourceHandle(ColorProperty, channel);
                DUCE.ResourceHandle hPositionAnimations = GetAnimationResourceHandle(PositionProperty, channel);
                DUCE.ResourceHandle hRangeAnimations = GetAnimationResourceHandle(RangeProperty, channel); 
                DUCE.ResourceHandle hConstantAttenuationAnimations = GetAnimationResourceHandle(ConstantAttenuationProperty, channel);
                DUCE.ResourceHandle hLinearAttenuationAnimations = GetAnimationResourceHandle(LinearAttenuationProperty, channel); 
                DUCE.ResourceHandle hQuadraticAttenuationAnimations = GetAnimationResourceHandle(QuadraticAttenuationProperty, channel); 
                DUCE.ResourceHandle hDirectionAnimations = GetAnimationResourceHandle(DirectionProperty, channel);
                DUCE.ResourceHandle hOuterConeAngleAnimations = GetAnimationResourceHandle(OuterConeAngleProperty, channel); 
                DUCE.ResourceHandle hInnerConeAngleAnimations = GetAnimationResourceHandle(InnerConeAngleProperty, channel);

                // Pack & send command packet
                DUCE.MILCMD_SPOTLIGHT data; 
                unsafe
                { 
                    data.Type = MILCMD.MilCmdSpotLight; 
                    data.Handle = _duceResource.GetHandle(channel);
                    data.htransform = hTransform; 
                    if (hColorAnimations.IsNull)
                    {
                        data.color = CompositionResourceManager.ColorToMilColorF(Color);
                    } 
                    data.hColorAnimations = hColorAnimations;
                    if (hPositionAnimations.IsNull) 
                    { 
                        data.position = CompositionResourceManager.Point3DToMilPoint3F(Position);
                    } 
                    data.hPositionAnimations = hPositionAnimations;
                    if (hRangeAnimations.IsNull)
                    {
                        data.range = Range; 
                    }
                    data.hRangeAnimations = hRangeAnimations; 
                    if (hConstantAttenuationAnimations.IsNull) 
                    {
                        data.constantAttenuation = ConstantAttenuation; 
                    }
                    data.hConstantAttenuationAnimations = hConstantAttenuationAnimations;
                    if (hLinearAttenuationAnimations.IsNull)
                    { 
                        data.linearAttenuation = LinearAttenuation;
                    } 
                    data.hLinearAttenuationAnimations = hLinearAttenuationAnimations; 
                    if (hQuadraticAttenuationAnimations.IsNull)
                    { 
                        data.quadraticAttenuation = QuadraticAttenuation;
                    }
                    data.hQuadraticAttenuationAnimations = hQuadraticAttenuationAnimations;
                    if (hDirectionAnimations.IsNull) 
                    {
                        data.direction = CompositionResourceManager.Vector3DToMilPoint3F(Direction); 
                    } 
                    data.hDirectionAnimations = hDirectionAnimations;
                    if (hOuterConeAngleAnimations.IsNull) 
                    {
                        data.outerConeAngle = OuterConeAngle;
                    }
                    data.hOuterConeAngleAnimations = hOuterConeAngleAnimations; 
                    if (hInnerConeAngleAnimations.IsNull)
                    { 
                        data.innerConeAngle = InnerConeAngle; 
                    }
                    data.hInnerConeAngleAnimations = hInnerConeAngleAnimations; 

                    // Send packed command structure
                    channel.SendCommand(
                        (byte*)&data, 
                        sizeof(DUCE.MILCMD_SPOTLIGHT));
                } 
            } 
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:96,代码来源:SpotLight.cs


注:本文中的System.Windows.Media.Composition.DUCE.SendCommand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。