Ejemplo n.º 1
0
        void ICommandModule.ProcessCommand(string command, params string[] arguments)
        {
            switch (command)
            {
            case "add":
                if (arguments.Length > 3)
                {
                    TimeoutEnabled = Converter.Convert <bool>(arguments[3]);
                }

                AddEntry(new ReviewEntry {
                    Name   = arguments[0],
                    Value  = int.Parse(arguments[1]),
                    Weight = double.Parse(arguments[2], CultureInfo.InvariantCulture)
                });
                break;

            case "clear":
                Clear();
                break;

            case "show":
                if (arguments.Length > 0)
                {
                    TimeoutEnabled = Converter.Convert <bool>(arguments[0]);
                }

                ReviewChanged?.Invoke();
                break;

            default:
                throw new Exception($"Command '{command}' not supported");
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// adds an entry to the current review
 /// </summary>
 /// <param name="entry">entry to add</param>
 public void AddEntry(ReviewEntry entry)
 {
     entries.Add(entry);
     ReviewChanged?.Invoke();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// clears current review
 /// </summary>
 public void Clear()
 {
     TimeoutEnabled = true;
     entries.Clear();
     ReviewChanged?.Invoke();
 }