Exemplo n.º 1
0
        private void WriteEventToOutput(IKernelEvent kernelEvent)
        {
            if (kernelEvent is ReturnValueProduced rvp && rvp.Value is DisplayedValue)
            {
                return;
            }

            var envelope = KernelEventEnvelope.Create(kernelEvent);

            var serialized = KernelEventEnvelope.Serialize(envelope);

            _output.Write(serialized);
        }
Exemplo n.º 2
0
        private void DeserializeAndSendEvent(string line)
        {
            try
            {
                var kernelEventEnvelope = KernelEventEnvelope.Deserialize(line);
                _kernelEvents.OnNext(kernelEventEnvelope.Event);
            }
            catch (JsonReaderException ex)
            {
                var diagnosticEvent = new DiagnosticLogEntryProduced(
                    $"Error while parsing command: {ex.Message}\n{line}");

                _kernelEvents.OnNext(diagnosticEvent);
            }
        }
Exemplo n.º 3
0
        private void WriteEventToOutput(IKernelEvent kernelEvent)
        {
            if (kernelEvent is ReturnValueProduced rvp && rvp.Value is DisplayedValue)
            {
                return;
            }

            if (kernelEvent.Command is {} command)
            {
                if (command.Properties.Count == 0)
                {
                }
            }

            var envelope = KernelEventEnvelope.Create(kernelEvent);

            var serialized = KernelEventEnvelope.Serialize(envelope);

            _output.Write(serialized);
        }
Exemplo n.º 4
0
        private void DeserializeAndSendEvent(string line)
        {
            IKernelEventEnvelope kernelEventEnvelope = null;

            try
            {
                kernelEventEnvelope = KernelEventEnvelope.Deserialize(line);
            }
            catch (Exception ex)
            {
                var diagnosticEvent = new DiagnosticLogEntryProduced(
                    $"Error while parsing command: {ex.Message}\n{line}", KernelCommand.None);

                _kernelEvents.OnNext(diagnosticEvent);
            }

            if (kernelEventEnvelope is not null)
            {
                _kernelEvents.OnNext(kernelEventEnvelope.Event);
            }
        }