예제 #1
0
파일: NativeCalls.cs 프로젝트: zmyer/rDSN
        public static bool dsn_register_app_managed(string type_name, dsn_app_create create, dsn_app_start_managed start, dsn_app_destroy destroy)
        {
            dsn_app_start start2 = (app_context, argc, argv) =>
            {
                var args = CopyCStringArrayToManaged(argv, argc);
                return(start(app_context, args));
            };

            var app = new dsn_app
            {
                mask      = DSN_APP_MASK_DEFAULT,
                type_name = type_name,
                layer1    =
                {
                    create  = Marshal.GetFunctionPointerForDelegate(create),
                    start   = Marshal.GetFunctionPointerForDelegate(start2),
                    destroy = Marshal.GetFunctionPointerForDelegate(destroy)
                }
            };

            return(dsn_register_app(app));
        }
예제 #2
0
파일: NativeCalls.cs 프로젝트: zmyer/rDSN
 public static extern bool dsn_register_app(dsn_app app);
예제 #3
0
        public static bool dsn_register_app_managed(string type_name, dsn_app_create create, dsn_app_start_managed start, dsn_app_destroy destroy)
        {
            dsn_app_start start2 = (app_context, argc, argv) =>
            {
                var args = CopyCStringArrayToManaged(argv, argc);
                return start(app_context, args);
            };

            var app = new dsn_app
            {
                mask = DSN_APP_MASK_DEFAULT,
                type_name = type_name,
                layer1 =
                {
                    create = Marshal.GetFunctionPointerForDelegate(create),
                    start = Marshal.GetFunctionPointerForDelegate(start2),
                    destroy = Marshal.GetFunctionPointerForDelegate(destroy)
                }
            };

            return dsn_register_app(app);
        }
예제 #4
0
 public static extern bool dsn_register_app(dsn_app app);