Ejemplo n.º 1
0
        /// <summary>
        /// Create an OpenWF Composition element.
        /// </summary>
        /// <param name="device">
        /// A <see cref="WfcDevice"/> which the source is created on.
        /// </param>
        /// <param name="ctx">
        /// A <see cref="WfcContext"/> which the source is created on.
        /// </param>
        internal WfcElement(WfcDevice device, WfcContext ctx)
        {
            if (device == null)
            {
                throw new ArgumentNullException("device");
            }

            if ((_Handle = Wfc.CreateElement(device.Handle, ctx.Handle, null)) == Wfc.INVALID_HANDLE)
            {
                throw new InvalidOperationException(String.Format("unable to create OpenWF element"));
            }

            _Device = device;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create an OpenWF Composition source.
        /// </summary>
        /// <param name="device">
        /// A <see cref="WfcDevice"/> which the source is created on.
        /// </param>
        /// <param name="ctx">
        /// A <see cref="WfcContext"/> which the source is created on.
        /// </param>
        /// <param name="stream">
        /// A <see cref="NativeStreamType"/> that specifies the native source stream.
        /// </param>
        internal WfcSource(WfcDevice device, WfcContext ctx, NativeStreamType stream)
        {
            if (device == null)
            {
                throw new ArgumentNullException("device");
            }

            if ((_Handle = Wfc.CreateSourceFromStream(device.Handle, ctx.Handle, stream, null)) == Wfc.INVALID_HANDLE)
            {
                throw new InvalidOperationException(String.Format("unable to create OpenWF source"));
            }

            _Device = device;
        }