Ejemplo n.º 1
0
        /// <summary>
        /// return ienumerable of all class command and functions command in specific class
        /// </summary>
        /// <param name="className">name of class command</param>
        private static IEnumerable <string> AllCommandsByClassName(string className)
        {
            var commands = (ProgramStorageQueries.GetInfoValueOfClassCommand()).OfType <string>().ToList();

            if (className != "")
            {
                commands.AddRange(ProgramStorageQueries.GetFunctionsCommand(className));
            }
            return(commands);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// read line from console
        /// </summary>
        /// <param name="className">name of class command</param>
        public static string[] ReadeUserCommandLineInput(string className = "")
        {
            var prefix = $"\n{className} > ";

            Console.Write(prefix);
            var commands = (ProgramStorageQueries.GetInfoValueOfClassCommand()).OfType <string>().ToList();
            var input    = ReadeKey(prefix.Length - 1, AllCommandsByClassName(className));

            Console.WriteLine();

            var array  = input.Split(' ');
            var length = array.Length;

            var args = new string[length];

            for (int i = 0; i < length; i++)
            {
                args[i] = array[i];
            }

            return(args);
        }