public MainForm(StartupArgs startupArgs) { if (startupArgs == null) throw new ArgumentNullException("startupArgs"); this.startupArgs = startupArgs; InitializeComponent(); }
public static StartupArgs Parse(string[] arguments, StartupArgs[] args, StartupArgs @default) { if (@default == null) { throw new ArgumentNullException("default"); } // return default arg if no successfully parsed arg was found return(Parse(arguments, args) ?? @default); }
public static StartupArgs Parse(string[] arguments, StartupArgs[] args) { if (arguments == null) throw new ArgumentNullException("arguments"); if (args == null) throw new ArgumentNullException("args"); // find first successfully parsed arg return args.FirstOrDefault(a => a.Parse(arguments)); }
public static StartupArgs Parse(string[] arguments, StartupArgs[] args, Func<string[], StartupArgs> resolveDefault) { if (resolveDefault == null) throw new ArgumentNullException("resolveDefault"); // return resolver result if no successfully parsed arg was found return Parse(arguments, args) ?? resolveDefault(arguments); }
public static StartupArgs Parse(string[] arguments, StartupArgs[] args, StartupArgs @default) { if (@default == null) throw new ArgumentNullException("default"); // return default arg if no successfully parsed arg was found return Parse(arguments, args) ?? @default; }