PowerArgs.Cli.PowerArgsRichCommandLineReader.PassThroughOrTryGetAmbientDefinition C# (CSharp) Method

PassThroughOrTryGetAmbientDefinition() private static method

private static PassThroughOrTryGetAmbientDefinition ( CommandLineArgumentsDefinition def ) : CommandLineArgumentsDefinition
def CommandLineArgumentsDefinition
return CommandLineArgumentsDefinition
        private static CommandLineArgumentsDefinition PassThroughOrTryGetAmbientDefinition(CommandLineArgumentsDefinition def)
        {
            if(def != null)
            {
                return def;
            }
            else if(ArgHook.HookContext.Current != null && ArgHook.HookContext.Current.Definition != null)
            {
                return ArgHook.HookContext.Current.Definition;
            }
            else
            {
                throw new NullReferenceException("There is no ambient CommandLineArgumentsDefinition argument and you did not pass one in explicitly");
            }
        }