Пример #1
0
            private static Result CloneImpl(IntPtr thisPtr, out IntPtr streamPointer)
            {
                streamPointer = IntPtr.Zero;
                Result result = Result.Ok;

                try
                {
                    IStream stream = ((IStream)CppObjectShadow.ToShadow <ComStreamShadow>(thisPtr).Callback).Clone();
                    streamPointer = ComStream.ToIntPtr(stream);
                }
                catch (SharpDXException ex)
                {
                    result = ex.ResultCode;
                }
                catch (Exception ex)
                {
                    result = (Result)Result.Fail.Code;
                }
                return(result);
            }
Пример #2
0
            private static Result CloneImpl(IntPtr thisPtr, out IntPtr streamPointer)
            {
                streamPointer = IntPtr.Zero;
                var result = Result.Ok;

                try
                {
                    var shadow   = ToShadow <ComStreamShadow>(thisPtr);
                    var callback = ((IStream)shadow.Callback);
                    var clone    = callback.Clone();
                    streamPointer = ComStream.ToIntPtr(clone);
                }
                catch (SharpDXException exception)
                {
                    result = exception.ResultCode;
                }
                catch (Exception)
                {
                    result = Result.Fail.Code;
                }
                return(result);
            }
Пример #3
0
 public long CopyTo(IStream streamDest, long numberOfBytesToCopy, out long bytesWritten)
 {
     this.CopyTo_(ComStream.ToIntPtr(streamDest), numberOfBytesToCopy, out bytesWritten);
     return(bytesWritten);
 }