Exemple #1
0
 void RaiseExecutionComplete(PrologQueryEventArgs e)
 {
     if (ExecutionComplete != null)
     {
         ExecutionComplete(this, e);
     }
 }
Exemple #2
0
        void CodeExecuted(object sender, PrologQueryEventArgs e)
        {
            var machine = sender as PrologMachine;
            machine.ExecutionComplete -= CodeExecuted;

            Dictionary<string, string> values = null;
            if (e.Results != null)
                values = e.Results.Variables.ToDictionary(value => value.Name, value => value.Text);
            if( Executed!=null )
                Executed(this, new ExecutionEventArgs(values));
        }
Exemple #3
0
        void CodeExecuted(object sender, PrologQueryEventArgs e)
        {
            var machine = sender as PrologMachine;
            machine.ExecutionComplete -= CodeExecuted;

            if (e.Results == null)
            {
                textResult.Text = "No result available";
                return;
            }

            var sb = new StringBuilder();

            string prefix = null;
            foreach (var variable in e.Results.Variables)
            {
                sb.Append(prefix); prefix = Environment.NewLine;
                sb.AppendFormat("{0} = {1}", variable.Name, variable.Text);
            }

            textResult.Text = sb.ToString();
        }
 void OnMachineExecutionComplete(object sender, PrologQueryEventArgs e)
 {
 }
        void OnMachineExecutionComplete(object sender, PrologQueryEventArgs e)
        {
            if (e.Results != null)
            {
                var sb = new StringBuilder();

                string prefix = null;
                foreach (var variable in e.Results.Variables)
                {
                    sb.Append(prefix); prefix = System.Environment.NewLine;
                    sb.AppendFormat("{0} = {1}", variable.Name, variable.Text);
                }

                var variables = sb.ToString();
                if (!string.IsNullOrEmpty(variables))
                {
                    TranscriptProvider.Transcript.AddTranscriptEntry(TranscriptEntryTypes.Response, variables);
                }
                TranscriptProvider.Transcript.AddTranscriptEntry(TranscriptEntryTypes.Response, Resources.Strings.ResponseSuccess);

                if (StatisticsEnabled)
                {
                    TranscriptProvider.Transcript.AddTranscriptEntry(TranscriptEntryTypes.Response, string.Format(Resources.Strings.CommandViewModel_ExecutionTime
                    //StatusUpdateProvider.Publish(string.Format(Resources.Strings.CommandViewModel_ExecutionTime
                        , MachineProvider.Machine.PerformanceStatistics.ElapsedTime
                        , MachineProvider.Machine.PerformanceStatistics.InstructionCount));
                }
            }
            else
            {
                TranscriptProvider.Transcript.AddTranscriptEntry(TranscriptEntryTypes.Response, Resources.Strings.ResponseFailure);
            }
        }
 private void RaiseExecutionComplete(PrologQueryEventArgs e)
 {
     if (ExecutionComplete != null)
     {
         ExecutionComplete(this, e);
     }
 }
 void OnExecutionComplete(object sender, PrologQueryEventArgs e)
 {
     AdjustVariables();
 }
 static PrologQueryEventArgs()
 {
     Empty = new PrologQueryEventArgs(null);
 }
Exemple #9
0
 static PrologQueryEventArgs()
 {
     Empty = new PrologQueryEventArgs(null);
 }