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, OnError); PechkinStatic.SetWarningCallback(_converter, OnWarning); PechkinStatic.SetPhaseChangedCallback(_converter, OnPhaseChanged); PechkinStatic.SetProgressChangedCallback(_converter, OnProgressChanged); PechkinStatic.SetFinishedCallback(_converter, OnFinished); if (_log.IsTraceEnabled) { _log.Trace("T:" + Thread.CurrentThread.Name + " Added callbacks to converter"); } }
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"); }