示例#1
0
            public ProgressFuncsWrapper(ProgressStartFunc start, ProgressUpdateFunc update, ProgressStopFunc stop)
            {
                managed_start = start;
                if (managed_start != null)
                    NativeStartDelegate = new ProgressStartFuncNative (NativeStartCallback);

                managed_update = update;
                if (managed_update != null)
                    NativeUpdateDelegate = new ProgressUpdateFuncNative (NativeUpdateCallback);

                managed_stop = stop;
                if (managed_stop != null)
                    NativeStopDelegate = new ProgressStopFuncNative (NativeStopCallback);
            }
示例#2
0
 public void SetProgressFuncs(ProgressStartFunc start_func, ProgressUpdateFunc update_func, ProgressStopFunc stop_func)
 {
     progress_funcs_wrapper = new ProgressFuncsWrapper (start_func, update_func, stop_func);
     IntPtr data = IntPtr.Zero;
     if (start_func != null || update_func != null || stop_func != null)
         data = (IntPtr) GCHandle.Alloc (progress_funcs_wrapper);
     gp_glue_context_set_progress_funcs (gluecontext,
                         progress_funcs_wrapper.NativeStartDelegate,
                         progress_funcs_wrapper.NativeUpdateDelegate,
                         progress_funcs_wrapper.NativeStopDelegate,
                         data);
 }