예제 #1
0
        //
        public static IList <T> GetCallbacks <T>(ExecutionProperties executionProperties)
            where T : class
        {
            List <T> list = null;

            if (!executionProperties.IsEmpty)
            {
                T temp;
                foreach (KeyValuePair <string, object> item in executionProperties)
                {
                    temp = item.Value as T;

                    if (temp != null)
                    {
                        if (list == null)
                        {
                            list = new List <T>();
                        }
                        list.Add(temp);
                    }
                }
            }

            return(list);
        }
예제 #2
0
        public static ICompiler NewCompiler(Language language, string sourceCode, Editor caller,
                                            string langVersion = null)
        {
            IExecutionProperties exProps  = new ExecutionProperties(App.Preferences.ExecuteTimeout);
            ICompilerProperties  comProps = new CompilerProperties(App.Preferences.ExecuteTimeout, langVersion);
            var properties = new Compilers.Properties(language, sourceCode,
                                                      App.Preferences.NetImports,
                                                      App.Preferences.JdkPath,
                                                      App.Preferences.PyPath,
                                                      exProps, comProps,
                                                      new FiddleGlobals(caller));

            return(Host.NewCompiler(properties));
        }
예제 #3
0
 public static void Update(this ExecutionProperties properties, string name, object value)
 {
     properties.Remove(name);
     properties.Add(name, value);
 }