コード例 #1
0
ファイル: SimplePechkin.cs プロジェクト: kylepmanuel/Pechkin
        protected virtual void OnBegin(IntPtr converter)
        {
            int expectedPhaseCount = PechkinStatic.GetPhaseCount(converter);

            if (_log.IsTraceEnabled)
            {
                _log.Trace("T:" + Thread.CurrentThread.Name + " Conversion started, " + expectedPhaseCount + " phases awaiting");
            }

            BeginEventHandler handler = Begin;

            try
            {
                handler?.Invoke(this, expectedPhaseCount);
            } catch (Exception e)
            {
                _log.Warn("T:" + Thread.CurrentThread.Name + " Exception in Begin event handler", e);
            }
        }
コード例 #2
0
ファイル: SimplePechkin.cs プロジェクト: yellowjime/Examples
        protected virtual void OnBegin(IntPtr converter)
        {
            int expectedPhaseCount = PechkinStatic.GetPhaseCount(converter);

            Tracer.Trace("T:" + Thread.CurrentThread.Name + " Conversion started, " + expectedPhaseCount + " phases awaiting");

            BeginEventHandler handler = this.Begin;

            try
            {
                if (handler != null)
                {
                    handler(this, expectedPhaseCount);
                }
            }
            catch (Exception e)
            {
                Tracer.Warn(String.Format("T:" + Thread.CurrentThread.Name + " Exception in Begin event handler {0}", e));
            }
        }