Ejemplo n.º 1
0
 public CodeCellState(
     CodeCellId codeCellId,
     CodeCellBuffer buffer)
 {
     CodeCellId = codeCellId;
     Buffer     = buffer;
 }
Ejemplo n.º 2
0
        public void Empty()
        {
            CodeCellId emptySubmissionId     = default;
            DocumentId emptyDocumentId       = default;
            DocumentId convertedSubmissionId = emptySubmissionId.ToDocumentId();

            Assert.Equal(emptyDocumentId, convertedSubmissionId);
        }
Ejemplo n.º 3
0
        public void Create()
        {
            var projectId    = Guid.NewGuid();
            var id           = Guid.NewGuid();
            var submissionId = new CodeCellId(projectId, id);

            Assert.Equal(projectId, submissionId.ProjectId);
            Assert.Equal(id, submissionId.Id);
        }
Ejemplo n.º 4
0
        public void Parse()
        {
            var projectId    = Guid.NewGuid();
            var id           = Guid.NewGuid();
            var submissionId = CodeCellId.Parse($"{projectId}/{id}");

            Assert.Equal(projectId, submissionId.ProjectId);
            Assert.Equal(id, submissionId.Id);
        }
 internal CapturedOutputSegment(
     CodeCellId codeCellId,
     int fileDescriptor,
     char singleChar) : this(
         codeCellId,
         fileDescriptor,
         singleChar.ToString())
 {
 }
 CapturedOutputSegment(
     CodeCellId codeCellId,
     int fileDescriptor,
     string value)
 {
     CodeCellId     = codeCellId;
     FileDescriptor = fileDescriptor;
     Value          = value;
 }
Ejemplo n.º 7
0
 internal CapturedOutputSegment(
     CodeCellId codeCellId,
     int fileDescriptor,
     char singleChar)
 {
     CodeCellId     = codeCellId;
     FileDescriptor = fileDescriptor;
     Value          = singleChar.ToString();
 }
 internal CapturedOutputSegment(
     CodeCellId codeCellId,
     int fileDescriptor,
     char [] buffer,
     int index,
     int count) : this(
         codeCellId,
         fileDescriptor,
         new string (buffer, index, count))
 {
 }
Ejemplo n.º 9
0
 internal CapturedOutputSegment(
     CodeCellId codeCellId,
     int fileDescriptor,
     char [] buffer,
     int index,
     int count)
 {
     CodeCellId     = codeCellId;
     FileDescriptor = fileDescriptor;
     Value          = new string (buffer, index, count);
 }
Ejemplo n.º 10
0
 public Compilation(
     CodeCellId codeCellId,
     int submissionNumber,
     EvaluationEnvironment evaluationEnvironment,
     bool isResultAnExpression,
     AssemblyDefinition executableAssembly,
     IReadOnlyList <AssemblyDefinition> references)
 {
     CodeCellId            = codeCellId;
     SubmissionNumber      = submissionNumber;
     EvaluationEnvironment = evaluationEnvironment;
     IsResultAnExpression  = isResultAnExpression;
     ExecutableAssembly    = executableAssembly;
     References            = references;
 }
Ejemplo n.º 11
0
 public CodeCellState(CodeCellId codeCellId)
 => CodeCellId = codeCellId;
Ejemplo n.º 12
0
 internal CapturedOutputSegment(int fileDescriptor, char [] buffer, int index, int count, CodeCellId context)
 {
     FileDescriptor = fileDescriptor;
     Value          = new string (buffer, index, count);
     Context        = context;
 }
Ejemplo n.º 13
0
 public static DocumentId ToDocumentId(this CodeCellId codeCellId)
 => DocumentId.CreateFromSerialized(
     ProjectId.CreateFromSerialized(codeCellId.ProjectId),
     codeCellId.Id);
Ejemplo n.º 14
0
 public Writer(int fileDescriptor, CapturedOutputWriter monitor)
 {
     this.fileDescriptor = fileDescriptor;
     this.monitor        = monitor;
     this.codeCellId     = monitor.codeCellId;
 }
Ejemplo n.º 15
0
 public CapturedOutputWriter(CodeCellId codeCellId)
 {
     this.codeCellId = codeCellId;
     StandardOutput  = new Writer(StandardOutputFd, this);
     StandardError   = new Writer(StandardErrorFd, this);
 }
Ejemplo n.º 16
0
 internal CapturedOutputSegment(int fileDescriptor, char singleChar, CodeCellId context)
 {
     FileDescriptor = fileDescriptor;
     Value          = singleChar.ToString();
     Context        = context;
 }
Ejemplo n.º 17
0
 public Writer(int fileDescriptor, CapturedOutputWriter monitor)
 {
     this.fileDescriptor = fileDescriptor;
     this.monitor        = monitor;
     this.context        = monitor.context;
 }