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); } }
/// <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; } }
public StateBlock(Device device, StateBlockType stateBlockType) { throw new NotImplementedException(); }