public int GetLockState(VirtualInstrument vi) { bool cached = false; int status = -1; if (vi != null) { status = ( int) vi.GetLockState(out cached); } return status; }