예제 #1
0
        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();
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        private static void HideCursor(IntPtr sctp)
        {
            Size Size = ScpCommands.InitDisplay(sctp);

            ScpCommands.SetCursor(sctp, new Point(Size.Width, 0));
        }