Exemplo n.º 1
0
 protected bool Equals(NConsoleOption other)
 {
     return(Name == other.Name && Function.Equals(other.Function) && Equals(AltFunction, other.AltFunction) &&
            Equals(CtrlFunction, other.CtrlFunction) && Equals(ShiftFunction, other.ShiftFunction) &&
            Equals(ComboFunction, other.ComboFunction) && Equals(Data, other.Data) &&
            Nullable.Equals(Color, other.Color));
 }
Exemplo n.º 2
0
        private static string FormatOption(NConsoleOption option, int i)
        {
            var  sb = new StringBuilder();
            char c  = GetDisplayOptionFromIndex(i);

            string?name = option.Name;

            if (option.Color.HasValue)
            {
                name = name.AddColor(option.Color.Value);
            }

            sb.Append($"[{c}]: ");

            if (name != null)
            {
                sb.Append($"{name} ");
            }

            if (option.Data != null)
            {
                sb.AppendLine();

                sb.Append($"{Strings.Indent(Strings.ViewString(option.Data))}");
            }

            if (!sb.ToString().EndsWith(StringConstants.NativeNewLine))
            {
                sb.AppendLine();
            }

            var f = FormatString(StringConstants.ASTERISK.ToString(), sb.ToString());

            //if (f.EndsWith('\n')) {
            //	f += '\n';
            //}

            return(f);
        }