Esempio n. 1
0
 private Result CreateStateBlock(IntPtr devicePointer, StateBlockType type, out IntPtr stateBlock)
 {
     try
     {
         this.Log.LogMethodSignatureTypesAndValues(devicePointer, type, "out");
         this.GetOrCreateDevice(devicePointer);
         this.StateBlocks.Add(new StateBlock(this.Device, type));
         stateBlock = this.StateBlocks.Last().NativePointer;
         return(Result.Ok);
     }
     catch (SharpDXException ex)
     {
         Log.Warn(ex);
         stateBlock = IntPtr.Zero;
         return(ex.ResultCode);
     }
     catch (Exception ex)
     {
         this.Log.Fatal(ex);
         stateBlock = IntPtr.Zero;
         return(Result.UnexpectedFailure);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StateBlock"/> class.
 /// </summary>
 /// <param name="device">The device.</param>
 /// <param name="type">The type.</param>
 public StateBlock(Device device, StateBlockType type)
 {
     device.CreateStateBlock(type, this);
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StateBlock"/> class.
 /// </summary>
 /// <param name="device">The device.</param>
 /// <param name="type">The type.</param>
 public StateBlock(Device device, StateBlockType type)
 {
     device.CreateStateBlock(type, this);
 }
 private Result CreateStateBlock(IntPtr devicePointer, StateBlockType type, out IntPtr stateBlock)
 {
     try
     {
         this.Log.LogMethodSignatureTypesAndValues(devicePointer, type, "out");
         this.GetOrCreateDevice(devicePointer);
         this.StateBlocks.Add(new StateBlock(this.Device, type));
         stateBlock = this.StateBlocks.Last().NativePointer;
         return Result.Ok;
     }
     catch (SharpDXException ex)
     {
         Log.Warn(ex);
         stateBlock = IntPtr.Zero;
         return ex.ResultCode;
     }
     catch (Exception ex)
     {
         this.Log.Fatal(ex);
         stateBlock = IntPtr.Zero;
         return Result.UnexpectedFailure;
     }
 }
Esempio n. 5
0
 public StateBlock(Device device, StateBlockType stateBlockType)
 {
     throw new NotImplementedException();
 }