Пример #1
0
 public static unsafe void RunApp(int numArgs, byte **args, Action <string[]> callback)
 {
     BeginRun();
     CurrentMain = (inNumArgs, argsPtr) => callback(SilkMarshal.PtrToStringArray((IntPtr)argsPtr, inNumArgs));
     CoreRunApp(numArgs, args, GetCallMainPtr());
     CurrentMain = null;
     EndRun();
 }
Пример #2
0
        public static unsafe void RunApp(IReadOnlyList <string> args, Action <string[]> callback)
        {
            BeginRun();
            var argsPtr = SilkMarshal.StringArrayToPtr(args);

            CurrentMain = (numArgs, inArgsPtr) => callback(SilkMarshal.PtrToStringArray((IntPtr)inArgsPtr, numArgs));
            CoreRunApp(args.Count, (byte **)argsPtr, GetCallMainPtr());
            CurrentMain = null;
            SilkMarshal.Free(argsPtr);
            EndRun();
        }