private byte[] GetVariableValue(string message, Variable variable) { this.BeginAtomic(); try { IntPtr Handle = this.AcquireHandle(); try { Size DisplaySize = ScpCommands.InitDisplay(Handle); ScpCommands.Display(Handle, message); ScpCommands.SetCursor(Handle, new Point(DisplaySize.Width - variable.Length, 1)); ScpCommands.WriteOnDisplay(Handle, new string('_', variable.Length)); ScpCommands.SetCursor(Handle, new Point(DisplaySize.Width - variable.Length, 1)); ScpCommands.StartInput(Handle, variable.MinLength, variable.Length); while (ScpCommands.GetInputHasEnded(Handle) == false) { Thread.Sleep(250); } ScpCommands.ClearDisplay(Handle); return(ScpCommands.EndInput(Handle)); } finally { this.ReleaseHandle(); } } finally { this.EndAtomic(); } }