예제 #1
0
 public extern static bool dsn_register_app_role(string type_name, dsn_app_create create, dsn_app_start start, dsn_app_destroy destroy);
예제 #2
0
        public static bool dsn_register_app_role_managed(string type_name, dsn_app_create create, dsn_app_start_managed start, dsn_app_destroy destroy)
        {
            dsn_app_start start2 = (IntPtr app_context, int argc, IntPtr argv) => 
            {
                var args = CopyCStringArrayToManaged(argv, argc);
                return start(app_context, args);
            };

            return dsn_register_app_role(type_name, create, start2, destroy);
        }
예제 #3
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));
        }
예제 #4
0
 public extern static bool dsn_register_app_role(string type_name, dsn_app_create create, dsn_app_start start, dsn_app_destroy destroy);
예제 #5
0
        public static bool dsn_register_app_role_managed(string type_name, dsn_app_create create, dsn_app_start_managed start, dsn_app_destroy destroy)
        {
            dsn_app_start start2 = (IntPtr app_context, int argc, IntPtr argv) =>
            {
                var args = CopyCStringArrayToManaged(argv, argc);
                return(start(app_context, args));
            };

            return(dsn_register_app_role(type_name, create, start2, destroy));
        }
예제 #6
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);
        }