Inheritance: System.MarshalByRefObject
Esempio n. 1
0
        public EvaluationCompletedEventArgs(Submission submission)
        {
            if (submission == null)
                throw new ArgumentNullException ("submission");

            Submission = submission;
        }
Esempio n. 2
0
            public Exception Evaluate(Submission submission, CompilerParameters cparams, string[] sources)
            {
                CSharpCodeProvider provider = new CSharpCodeProvider();
                CompilerResults results = provider.CompileAssemblyFromSource (cparams, sources);
                if (results.Errors.HasErrors)
                    return null;

                MethodInfo method = results.CompiledAssembly.GetType ("Instant.User.Evaluation").GetMethod ("Evaluate", BindingFlags.NonPublic | BindingFlags.Static);
                if (method == null)
                    return new InvalidOperationException ("Evaluation method not found");

                Hook.LoadSubmission (submission);

                try
                {
                    method.Invoke (null, null);
                }
                catch (OperationCanceledException)
                {
                }
                catch (Exception ex)
                {
                    return ex;
                }

                return null;
            }
Esempio n. 3
0
        public void PushSubmission(Submission submission)
        {
            Submission bumped = Interlocked.Exchange (ref this.nextSubmission, submission);
            if (bumped != null)
                bumped.Cancel();

            this.submissionWait.Set();
        }