Esempio n. 1
0
 /// <summary>
 /// Creates a new instance of ScriptEngine.
 /// </summary>
 /// <param name="Settings">The settings associated to the script engine.</param>
 /// <param name="scriptcheckinterval">The interval between each script update.</param>
 public ScriptEngine(ScriptSettings Settings, int scriptcheckinterval)
 {
     this.checkInterval = scriptcheckinterval;
     this.Settings      = Settings;
     scriptCollection   = new ScriptCollection(Settings);
     //scriptCheckerThread = new ProjectX_V3_Lib.Threading.BaseThread(new Threading.ThreadAction(Check_Updates),
     //         scriptcheckinterval, "Script Engine");
     //scriptCheckerThread.Start();
 }
Esempio n. 2
0
        /// <summary>
        /// Gets the namespace code for c#.
        /// </summary>
        /// <returns>Returns the namespace code.</returns>
        private static string getns(ScriptSettings Settings)
        {
            StringBuilder namespaceBuilder = new StringBuilder();

            foreach (string _namespace in Settings._namespaces.Values)
            {
                namespaceBuilder.Append("using ").Append(_namespace).Append(";").Append(Environment.NewLine);
            }
            return(namespaceBuilder.ToString());
        }
Esempio n. 3
0
 public static void SetNamespaces(ScriptSettings settings)
 {
     Content  = Content.Replace("__namespace__", getns(settings));
     Content2 = Content2.Replace("__namespace__", getns2(settings));
 }
 /// <summary>
 /// Creates a new instance of ScriptCollection.
 /// </summary>
 /// <param name="Settings">The settings associated with the script engine.</param>
 public ScriptCollection(ScriptSettings Settings)
 {
     scripts       = new ConcurrentDictionary <uint, MethodInfo>();
     this.Settings = Settings;
 }