public void PublishEvaluation( CodeCellId codeCellid, object result, EvaluationResultHandling resultHandling = EvaluationResultHandling.Replace) => MainThread.Post(() => PublishEvaluation(new Evaluation { CodeCellId = codeCellid, ResultHandling = resultHandling, Result = RepresentationManager.Prepare(result) }));
public Evaluation( CodeCellId codeCellId, EvaluationResultHandling resultHandling, object value) : this( codeCellId, EvaluationStatus.Success, resultHandling, value, evaluationDuration : default) // to avoid calling self { }
public void RenderResult( CultureInfo cultureInfo, object result, EvaluationResultHandling resultHandling) { if (resultElem == null) { ContentElement.AppendChild(resultElem = CreateContentContainer("result")); } else if (resultHandling == EvaluationResultHandling.Replace) { resultElem.RemoveChildren(); } rendererContext.Render( RenderState.Create(result, cultureInfo), resultElem); }
internal Evaluation( CodeCellId codeCellId, EvaluationStatus status, EvaluationResultHandling resultHandling, object value, TimeSpan evaluationDuration = default, int cultureLCID = 0, int uiCultureLCID = 0, bool initializedIntegration = false, IReadOnlyList <AssemblyDefinition> loadedAssemblies = null) { CodeCellId = codeCellId; Status = status; ResultHandling = resultHandling; switch (value) { case null: ResultRepresentations = Array.Empty <object> (); break; case RepresentedObject representedObject: ResultType = representedObject.RepresentedType; ResultRepresentations = representedObject; break; default: ResultType = RepresentedType.Lookup(value.GetType()); ResultRepresentations = new [] { value }; break; } EvaluationDuration = evaluationDuration; CultureLCID = cultureLCID; UICultureLCID = uiCultureLCID; InitializedIntegration = initializedIntegration; LoadedAssemblies = loadedAssemblies ?? Array.Empty <AssemblyDefinition> (); }
public CodeCellResultEvent( CodeCellId codeCellId, EvaluationResultHandling resultHandling, object value) { CodeCellId = codeCellId; ResultHandling = resultHandling; switch (value) { case null: break; case RepresentedObject representedObject: Type = representedObject.RepresentedType; ValueRepresentations = representedObject; break; default: Type = RepresentedType.Lookup(value.GetType()); ValueRepresentations = new [] { value }; break; } }
void ICodeCellView.RenderResult( CultureInfo cultureInfo, object result, EvaluationResultHandling resultHandling) { RenderBuffer(); if (result is RepresentedObject representedObject) { var interactiveObject = representedObject .OfType <InteractiveObject> () .FirstOrDefault(); if (interactiveObject != null) { result = interactiveObject.ToStringRepresentation; } else { result = "<unable to represent>"; } } output.WriteLine(result); }
Evaluation( CodeCellId codeCellId, EvaluationStatus status, EvaluationResultHandling resultHandling, IRepresentedType resultType, IReadOnlyList <object> resultRepresentations, bool resultIsException, TimeSpan evaluationDuration, int cultureLCID, int uiCultureLCID, bool initializedIntegration, IReadOnlyList <AssemblyDefinition> loadedAssemblies) { CodeCellId = codeCellId; Status = status; ResultHandling = resultHandling; ResultType = resultType; ResultRepresentations = resultRepresentations; EvaluationDuration = evaluationDuration; CultureLCID = cultureLCID; UICultureLCID = uiCultureLCID; InitializedIntegration = initializedIntegration; LoadedAssemblies = loadedAssemblies; }
public void PublishValueForCell(CodeCellId codeCellId, object result, EvaluationResultHandling resultHandling = EvaluationResultHandling.Replace);
public Evaluation(CodeCellId codeCellId, EvaluationResultHandling resultHandling, object value);
public void RenderResult(CultureInfo cultureInfo, object result, EvaluationResultHandling resultHandling) { }
public CodeCellResultEvent(CodeCellId codeCellId, EvaluationResultHandling resultHandling, object value);