Exemplo n.º 1
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));
        }
Exemplo n.º 2
0
 public static extern bool dsn_register_app(dsn_app app);
Exemplo n.º 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);
        }
Exemplo n.º 4
0
 public static extern bool dsn_register_app(dsn_app app);