public static short LengthCharCollector(Parameter myParam) { int sizeChar = 1; if (!(myParam is null)) { if (myParam.TypeParameter.Equals("char")) { do { ConsolePrinter.PrintHeader("Struct DotH DotC Builder", ConsoleColor.Green, ConsoleColor.Yellow); ConsolePrinter.PrintSubHeader("Step 2: Name of the Parameters: [Specify size of the char array]", ConsoleColor.Green, ConsoleColor.Yellow); Console.Write("\nThe type of the parameter is char, if its a string [char's array] \n" + "Write the length [Default 1]: "); int.TryParse(Console.ReadLine(), out sizeChar); } while (!DataValidator.ValidateAnswer("Are you sure? [y/n]: ")); if (sizeChar <= 0) { sizeChar = 1; } } } return((short)sizeChar); }
public static String ParameterAliasCollector(string parameterName) { StringBuilder data = new StringBuilder(); parameterName = parameterName.Trim().ToLower(); ConsolePrinter.PrintHeader($"Generating data For Parameter: {parameterName}.", ConsoleColor.Green, ConsoleColor.Yellow); ConsolePrinter.PrintSubHeader("Creating Alias For Parameter", ConsoleColor.Green, ConsoleColor.Yellow); data.Append(parameterName.Substring(0, 1).ToUpper()); data.Append(parameterName.Substring(1, parameterName.Length - 1).ToLower()); return(data.ToString()); }
public static string StructureAliasCollector(string structureName) { StringBuilder data = new StringBuilder(); structureName = structureName.Trim().ToLower(); ConsolePrinter.PrintHeader($"Generating data For Structure: {structureName}.", ConsoleColor.Green, ConsoleColor.Yellow); ConsolePrinter.PrintSubHeader("Creating Alias For Structure", ConsoleColor.Green, ConsoleColor.Yellow); data.Append(structureName.Substring(0, 1).ToUpper()); data.Append(structureName.Substring(1, structureName.Length - 1).ToLower()); return(data.ToString()); }
public static string ParameterNameCollector() { StringBuilder data = new StringBuilder(); do { ConsolePrinter.PrintHeader("Struct DotH DotC Builder", ConsoleColor.Green, ConsoleColor.Yellow); ConsolePrinter.PrintSubHeader("Step 2: Parameters: [For the structure]", ConsoleColor.Green, ConsoleColor.Yellow); Console.Write("\nWrite the name of the Parameter: "); data.Append(Console.ReadLine().Trim().Replace(" ", "").ToLower()); } while (!DataValidator.ValidateAnswer("Are you sure? [y/n]: ")); return(data.ToString()); }
private static short ContinueAddingParameters() { short continueAdd = 0; ConsolePrinter.PrintHeader("Struct DotH DotC Builder", ConsoleColor.Green, ConsoleColor.Yellow); ConsolePrinter.PrintSubHeader("Step 2: Name Your Parameters.", ConsoleColor.Green, ConsoleColor.Yellow); Console.Write("\nParameter Saved."); Console.Write("\nDo you Want to add more parameters?[ 1 = YES/ 0 = NO]: "); short.TryParse(Console.ReadLine(), out continueAdd); while (continueAdd != 1 && continueAdd != 0) { ConsolePrinter.PrintHeader("Error, invalid option selected. Please, Try Again.", ConsoleColor.Red, ConsoleColor.Magenta); Console.Write("\nDo you Want to add more parameters?[ 1 = YES/ 0 = NO]: "); short.TryParse(Console.ReadLine(), out continueAdd); } return(continueAdd); }
public static string ParameterTypeCollector(Parameter myParam) { string type = "int"; if (!(myParam is null)) { do { ConsolePrinter.PrintHeader("Struct DotH DotC Builder", ConsoleColor.Green, ConsoleColor.Yellow); ConsolePrinter.PrintSubHeader("Step 2: Name of the Parameters: [Select a type of the parameter.]", ConsoleColor.Green, ConsoleColor.Yellow); Console.WriteLine($"\nName of the Parameter: {myParam.NameParameter}\nAlias: {myParam.AliasNameParameter}\n"); type = MenuOfTypes(); while (type.Equals("")) { ConsolePrinter.PrintHeader("Error, invalid option selected. Please, Try Again.", ConsoleColor.Red, ConsoleColor.Magenta); type = MenuOfTypes(); } } while (!DataValidator.ValidateAnswer("Are you sure? [y/n]: ")); } return(type); }