Пример #1
0
        public HubConnectionListener(HubConnection connection, params string[] methodNames)
        {
            _ = connection ?? throw new ArgumentNullException(nameof(connection));
            _ = methodNames ?? throw new ArgumentNullException(nameof(methodNames));

            if (methodNames.Length < 1)
            {
                throw new ArgumentOutOfRangeException(nameof(methodNames), "Must contain at least one method name.");
            }

            foreach (var name in methodNames)
            {
                var counter = new WaitCounter();
                connection.On(name, async() => await counter.Increment());
                methods.Add(name, counter);
            }
        }
Пример #2
0
 internal Condition(string methodName, int count, WaitCounter counter)
 {
     MethodName = methodName;
     Count      = count;
     Counter    = counter;
 }