Exemplo n.º 1
0
        /// <summary>
        /// ITask enumerator interface for processing loaded log files
        /// </summary>
        /// <param name="logFilesLoaded">Which log files have been loaded</param>
        /// <returns>
        /// ITask enumerator
        /// </returns>
        public IEnumerator <ITask> LogFilesLoaded(loganalyzer.LogFilesLoaded logFilesLoaded)
        {
            if (this.wpfServicePort == null)
            {
                this.wpfServicePort = ccrwpf.WpfAdapter.Create(TaskQueue);
                var runWindow = this.wpfServicePort.RunWindow(() => new RawViewerPluginUi(this));
                yield return((Choice)runWindow);

                var exception = (Exception)runWindow;
                if (exception != null)
                {
                    LogError(exception);
                    StartFailed();
                    yield break;
                }

                this.userInterface = (RawViewerPluginUi)runWindow;
            }

            var get = new loganalyzer.Get();

            this.logAnalyzer.Post(get);

            loganalyzer.DssLogAnalyzerState logAnalyzerState = null;

            yield return(get.ResponsePort.Choice(
                             state => logAnalyzerState = state,
                             fault => LogError(fault)));

            if (logAnalyzerState == null)
            {
                yield break;
            }

            var listOfEnvelopes = logAnalyzerState.Envelopes;

            yield return(new IterativeTask(() => this.UpdateUiFromListsOfEnvelopes(listOfEnvelopes)));

            yield break;
        }
Exemplo n.º 2
0
        /// <summary>
        /// ITask enumerator interface for processing selected envelopes
        /// </summary>
        /// <param name="envelopesSelected">Envelopes selected</param>
        /// <returns>
        /// ITask enumerator
        /// </returns>
        public IEnumerator <ITask> EnvelopesSelected(loganalyzer.EnvelopesSelected envelopesSelected)
        {
            var get = new loganalyzer.Get();

            this.logAnalyzer.Post(get);

            loganalyzer.DssLogAnalyzerState logAnalyzerState = null;

            yield return(get.ResponsePort.Choice(
                             state => logAnalyzerState = state,
                             fault => LogError(fault)));

            if (logAnalyzerState == null)
            {
                yield break;
            }

            var envelopes = logAnalyzerState.CurrentSelectedEnvelopes;

            yield return(new IterativeTask(() => this.UpdateUiFromListsOfEnvelopes(new List <loganalyzer.EnvelopeList> {
                envelopes
            })));
        }