PowerArgs.CommandLineArgument.RunArgumentHook C# (CSharp) Method

RunArgumentHook() private method

private RunArgumentHook ( PowerArgs.ArgHook context, int>.Func orderby, Action hookAction ) : void
context PowerArgs.ArgHook
orderby int>.Func
hookAction Action
return void
        internal void RunArgumentHook(ArgHook.HookContext context, Func<ArgHook, int> orderby, Action<ArgHook> hookAction)
        {
            var oldCurrent = context.CurrentArgument;
            try
            {
                context.Property = Source as PropertyInfo;
                context.CurrentArgument = this;

                foreach (var hook in Hooks.OrderBy(orderby))
                {
                    hookAction(hook);
                }

                context.Property = null;
            }
            finally
            {
                context.CurrentArgument = oldCurrent;
            }
        }