AwaitableCoroutine.ThrowHelper.ArgNull C# (CSharp) Метод

ArgNull() публичный статический Метод

public static ArgNull ( string paramName ) : void
paramName string
Результат void
        public static void ArgNull(string paramName) => throw new ArgumentNullException(paramName);
        public static void InvalidOp(string message) => throw new InvalidOperationException(message);

Usage Example

        internal void AddOnCanceled(Action onCanceled)
        {
            if (onCanceled is null)
            {
                ThrowHelper.ArgNull(nameof(onCanceled));
            }

            if (IsCompleted)
            {
                ThrowHelper.InvalidOp("Coroutine is already completed");
            }

            if (IsCanceled)
            {
                onCanceled.Invoke();
                return;
            }

            var runner = ICoroutineRunner.GetContext();

            if (Runner == runner)
            {
                OnCalceled += onCanceled;
            }
            else
            {
                OnCalceled += () => runner.Context(onCanceled);
            }
        }
All Usage Examples Of AwaitableCoroutine.ThrowHelper::ArgNull