Ejemplo n.º 1
0
        public LiveModel(Configuration config) : base(BindConstructorArguments(config), new Delete <LiveModel>(NativeMethods.DeleteLiveModel))
        {
            this.managedErrorCallback = new NativeMethods.managed_background_error_callback_t(this.WrapStatusAndRaiseBackgroundError);
            NativeMethods.LiveModelSetCallback(this.NativeHandle, this.managedErrorCallback);

            this.managedTraceCallback = new NativeMethods.managed_trace_callback_t(this.SendTrace);
        }
        public LiveModel(Configuration config) : base(BindConstructorArguments(config), new Delete <LiveModel>(NativeMethods.DeleteLiveModel))
        {
            this.managedErrorCallback = new NativeMethods.managed_background_error_callback_t(this.WrapStatusAndRaiseBackgroundError);

            // DangerousGetHandle here is trivially safe, because .Dispose() cannot be called before the object is
            // constructed.
            NativeMethods.LiveModelSetCallback(this.DangerousGetHandle(), this.managedErrorCallback);

            this.managedTraceCallback = new NativeMethods.managed_trace_callback_t(this.SendTrace);
        }