public int Run(string program_name, string[] args) { var argc = 0; var argv = IntPtr.Zero; if (program_name != null) { program_name = program_name.Trim(); if (program_name.Length == 0) { throw new ArgumentException("program_name must not be empty.", "program_name"); } if (args == null) { throw new ArgumentNullException("args"); } var prog_args = new string [args.Length + 1]; prog_args [0] = program_name; args.CopyTo(prog_args, 1); argc = prog_args.Length; argv = new Argv(prog_args).Handle; } return(g_application_run(Handle, argc, argv)); }
public int Run (string program_name, string[] args) { var argc = 0; var argv = IntPtr.Zero; if (program_name != null) { program_name = program_name.Trim (); if (program_name.Length == 0) { throw new ArgumentException ("program_name must not be empty.", "program_name"); } if (args == null) { throw new ArgumentNullException ("args"); } var prog_args = new string [args.Length + 1]; prog_args [0] = program_name; args.CopyTo (prog_args, 1); argc = prog_args.Length; argv = new Argv (prog_args).Handle; } return g_application_run (Handle, argc, argv); }