Exemplo n.º 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);
    }
Exemplo n.º 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);
    }
Exemplo n.º 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>());
 }
Exemplo n.º 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);
    }
Exemplo n.º 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);
    }
Exemplo n.º 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));
 }