Exemplo n.º 1
0
        private void CreateConverter()
        {
            if (!_converter.Equals(IntPtr.Zero))
            {
                PechkinStatic.DestroyConverter(_converter);

                if (_log.IsTraceEnabled)
                {
                    _log.Trace("T:" + Thread.CurrentThread.Name + " Destroyed previous converter");
                }
            }

            // the damn lib... we can't reuse anything
            _globalConfigUnmanaged = _globalConfig.CreateGlobalConfig();
            _converter             = PechkinStatic.CreateConverter(_globalConfigUnmanaged);

            if (_log.IsTraceEnabled)
            {
                _log.Trace("T:" + Thread.CurrentThread.Name + " Created converter");
            }

            PechkinStatic.SetErrorCallback(_converter, _errorCallback);
            PechkinStatic.SetWarningCallback(_converter, _warningCallback);
            PechkinStatic.SetPhaseChangeCallback(_converter, _phaseChangedCallback);
            PechkinStatic.SetProgressChangeCallback(_converter, _progressChangedCallback);
            PechkinStatic.SetFinishedCallback(_converter, _finishedCallback);

            if (_log.IsTraceEnabled)
            {
                _log.Trace("T:" + Thread.CurrentThread.Name + " Added callbacks to converter");
            }

            _reinitConverter = false;
        }
Exemplo n.º 2
0
        public void Dispose()
        {
            if (!_converter.Equals(IntPtr.Zero))
            {
                if (_log.IsTraceEnabled)
                {
                    _log.Trace("T:" + Thread.CurrentThread.Name + " Releasing unmanaged converter");
                }

                PechkinStatic.DestroyConverter(_converter);
            }
        }
Exemplo n.º 3
0
        public void Dispose()
        {
            if (!this._converter.Equals(IntPtr.Zero))
            {
                Tracer.Trace("T:" + Thread.CurrentThread.Name + " Releasing unmanaged converter");

                PechkinStatic.DestroyConverter(this._converter);
            }

            this.IsDisposed = true;

            if (this.Disposed != null)
            {
                this.Disposed(this);
            }
        }
Exemplo n.º 4
0
        private void CreateConverter()
        {
            if (!this._converter.Equals(IntPtr.Zero))
            {
                PechkinStatic.DestroyConverter(this._converter);

                Tracer.Trace("T:" + Thread.CurrentThread.Name + " Destroyed previous converter");
            }

            // the damn lib... we can't reuse anything
            this._globalConfigUnmanaged = this._globalConfig.CreateGlobalConfig();
            this._converter             = PechkinStatic.CreateConverter(this._globalConfigUnmanaged);

            Tracer.Trace("T:" + Thread.CurrentThread.Name + " Created converter");

            PechkinStatic.SetErrorCallback(this._converter, this._onErrorDelegate);
            PechkinStatic.SetWarningCallback(this._converter, this._onWarningDelegate);
            PechkinStatic.SetPhaseChangedCallback(this._converter, this._onPhaseChangedDelegate);
            PechkinStatic.SetProgressChangedCallback(this._converter, this._onProgressChangedDelegate);
            PechkinStatic.SetFinishedCallback(this._converter, this._onFinishedDelegate);

            Tracer.Trace("T:" + Thread.CurrentThread.Name + " Added callbacks to converter");
        }