Example #1
0
    public void getListMethodGroup()
    {
        var lg = new ListGetter();
        var l  = GeneralUtils.getList <string>(r => lg.get123(r));

        Assert.AreEqual(new List <string> {
            "foo", "bar"
        }, l);
    }
Example #2
0
    /// <summary>
    /// Execute the command logic with specified data.
    /// </summary>
    /// <param name="data"><see cref="CommandData"/> passed over the network .</param>
    public override void Execute(CommandData data)
    {
        T[] values;
        if (ConverterArray != null)
        {
            values = ConverterArray(data);
        }
        else
        {
            values = data.GetAs <T[]>();
        }

        ListGetter.Invoke(data).AddRange(values);
    }
Example #3
0
 /// <summary>
 /// Execute the command logic with specified data.
 /// </summary>
 /// <param name="data"><see cref="CommandData"/> passed over the network .</param>
 public override void Execute(CommandData data)
 {
     ListGetter.Invoke(data).RemoveAt(data.GetAs <int>());
 }
Example #4
0
    /// <summary>
    /// Execute the command logic with specified data.
    /// </summary>
    /// <param name="data"><see cref="CommandData"/> passed over the network .</param>
    public override void Execute(CommandData data)
    {
        var args = data.GetAs <KeyValuePair <int, T> >();

        ListGetter.Invoke(data).Insert(args.Key, args.Value);
    }
Example #5
0
    /// <summary>
    /// Execute the command logic with specified data.
    /// </summary>
    /// <param name="data"><see cref="CommandData"/> passed over the network .</param>
    public override void Execute(CommandData data)
    {
        var args = data.GetAs <ValueTuple <int, int> >();

        ListGetter.Invoke(data).RemoveRange(args.Item1, args.Item2);
    }
Example #6
0
 /// <summary>
 /// Execute the command logic with specified data.
 /// </summary>
 /// <param name="data"><see cref="CommandData"/> passed over the network .</param>
 public override void Execute(CommandData data)
 {
     ListGetter.Invoke(data).Remove(GetElement(data));
 }