Ejemplo n.º 1
0
 void RaiseExecutionComplete(PrologQueryEventArgs e)
 {
     if (ExecutionComplete != null)
     {
         ExecutionComplete(this, e);
     }
 }
Ejemplo n.º 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));
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 4
0
 void OnMachineExecutionComplete(object sender, PrologQueryEventArgs e)
 {
 }
Ejemplo n.º 5
0
        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);
            }
        }
Ejemplo n.º 6
0
 private void RaiseExecutionComplete(PrologQueryEventArgs e)
 {
     if (ExecutionComplete != null)
     {
         ExecutionComplete(this, e);
     }
 }
 void OnExecutionComplete(object sender, PrologQueryEventArgs e)
 {
     AdjustVariables();
 }
 static PrologQueryEventArgs()
 {
     Empty = new PrologQueryEventArgs(null);
 }
Ejemplo n.º 9
0
 static PrologQueryEventArgs()
 {
     Empty = new PrologQueryEventArgs(null);
 }