Ejemplo n.º 1
0
        public async Task <SubmitCode> SubmitCode(KernelBase kernel, string codeFragment, SubmissionType submissionType = SubmissionType.Run)
        {
            var command = new SubmitCode(codeFragment, submissionType: submissionType);
            await kernel.SendAsync(command);

            return(command);
        }
Ejemplo n.º 2
0
 public async Task SubmitCode(KernelBase kernel, string[] codeFragments, SubmissionType submissionType = SubmissionType.Run)
 {
     foreach (var codeFragment in codeFragments)
     {
         var cmd = new SubmitCode(codeFragment, submissionType: submissionType);
         await kernel.SendAsync(cmd);
     }
 }
Ejemplo n.º 3
0
 public async Task SubmitCode(KernelBase kernel, string[] submissions, SubmissionType submissionType = SubmissionType.Run)
 {
     foreach (var submission in submissions)
     {
         var cmd = new SubmitCode(submission, submissionType: submissionType);
         await kernel.SendAsync(cmd);
     }
 }
Ejemplo n.º 4
0
        public async Task <SubmitCode[]> SubmitCode(KernelBase kernel, string[] codeFragments, SubmissionType submissionType = SubmissionType.Run)
        {
            var commands = new List <SubmitCode>();

            foreach (var codeFragment in codeFragments)
            {
                var cmd = new SubmitCode(codeFragment, submissionType: submissionType);
                await kernel.SendAsync(cmd);

                commands.Add(cmd);
            }
            return(commands.ToArray());
        }
Ejemplo n.º 5
0
 public async Task SubmitCode(KernelBase kernel, string submission, SubmissionType submissionType = SubmissionType.Run)
 {
     var command = new SubmitCode(submission, submissionType: submissionType);
     await kernel.SendAsync(command);
 }
Ejemplo n.º 6
0
        private Task <IKernelCommandResult> SendHoverRequest(KernelBase kernel, string code, int line, int character)
        {
            var command = new RequestHoverText(RequestHoverText.MakeDataUriFromContents(code), new LinePosition(line, character));

            return(kernel.SendAsync(command));
        }