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(); } }
public static void Display(IntPtr sctp, string message) { Size Size = ScpCommands.InitDisplay(sctp); string[] Strings = (message + new string('\n', Size.Height)).Split('\n'); ScpCommands.HideCursor(sctp); for (byte RowIndex = 0; RowIndex < Size.Height; RowIndex++) { string Message = Strings[RowIndex]; Message.PadRight(Size.Width, ' '); ScpCommands.Display(sctp, RowIndex, Message); } }
private void DisplayMessage(string message, TimeSpan timeout) { this.BeginAtomic(); try { IntPtr Handle = this.AcquireHandle(); try { ScpCommands.Display(Handle, message); Thread.Sleep(timeout); ScpCommands.ClearDisplay(Handle); } finally { this.ReleaseHandle(); } } finally { this.EndAtomic(); } }