Пример #1
0
        private void CrashItemEngine_SourceObserver(CIEngine.TSourceEvent aEvent, CIEngineSource aSource, object aParameter)
        {
            if (iReportProgress)
            {
                string msg = string.Empty;
                //
                switch (aEvent)
                {
                case CIEngine.TSourceEvent.EEventSourceReady:
                    msg = string.Format("Reading file: [{0}], progress: 100%", aSource.FileName);
                    break;

                case CIEngine.TSourceEvent.EEventSourceProgress:
                    if (aParameter != null && aParameter is int)
                    {
                        msg = string.Format("Reading file: [{0}], progress: {1:d3}%", aSource.FileName, (int)aParameter);
                    }
                    break;

                default:
                    break;
                }

                // Output a message only if we have one
                if (string.IsNullOrEmpty(msg) == false)
                {
                    Print(msg);
                }
            }
        }
Пример #2
0
        private void CrashItemEngine_SourceObserver(CIEngine.TSourceEvent aEvent, CIEngineSource aSource, object aParameter)
        {
            string msg = string.Empty;

            //
            switch (aEvent)
            {
            case CIEngine.TSourceEvent.EEventSourceStateChanged:
                if (aSource.State == CIEngineSource.TState.EStateProcessing)
                {
                    iProgressReporter.StepBegin("Processing crash file: " + aSource.FileName, aSource.FileName, 100);
                }
                break;

            case CIEngine.TSourceEvent.EEventSourceReady:
                iProgressReporter.StepEnd(string.Empty, aSource.FileName);
                break;

            case CIEngine.TSourceEvent.EEventSourceProgress:
                if (aParameter != null && aParameter is int)
                {
                    iProgressReporter.StepProgress(string.Empty, (int)aParameter, aSource.FileName);
                }
                break;

            default:
                break;
            }
        }