Esempio n. 1
0
        public string ParseCustomTag(IZeusCodeSegment segment, string text)
        {
            ArrayList extraData = segment.ExtraData;
            string    data = null, path = null;
            string    returnValue = string.Empty;

            if (text.StartsWith(INCLUDE_FILE_COMPILE))
            {
                data        = text.Substring(INCLUDE_FILE_COMPILE.Length).Trim();
                path        = DotNetScriptEngine.MakeAbsolute(data, segment.ITemplate.FilePath);
                returnValue = this.IncludeFileCompile(path);
            }
            else if (text.StartsWith(INCLUDE_FILE))
            {
                data        = text.Substring(INCLUDE_FILE.Length).Trim();
                path        = DotNetScriptEngine.MakeAbsolute(data, segment.ITemplate.FilePath);
                returnValue = this.IncludeFile(path);
            }
            else if (text.StartsWith(COMPILER_VERSION))
            {
                data = text.Substring(COMPILER_VERSION.Length).Trim();
                this.SetCompilerVersion(data, extraData);
            }
            else if (text.StartsWith(COMPILER_VERSION_ALT))
            {
                data = text.Substring(COMPILER_VERSION_ALT.Length).Trim();
                this.SetCompilerVersion(data, extraData);
            }
            else if (text.StartsWith(INCLUDE_REFERENCE))
            {
                data = text.Substring(INCLUDE_REFERENCE.Length).Trim();
                this.IncludeReference(data, extraData);
            }
            else if (text.StartsWith(INCLUDE_REFERENCE_ALT))
            {
                data = text.Substring(INCLUDE_REFERENCE_ALT.Length).Trim();
                this.IncludeReference(data, extraData);
            }
            else if (text.StartsWith(INCLUDE_NAMESPACE))
            {
                data = text.Substring(INCLUDE_NAMESPACE.Length).Trim();
                this.IncludeNamespace(data, extraData);
            }
            else if (text.StartsWith(INCLUDE_NAMESPACE_ALT))
            {
                data = text.Substring(INCLUDE_NAMESPACE_ALT.Length).Trim();
                this.IncludeNamespace(data, extraData);
            }
            else if (text.StartsWith(INCLUDE_DEBUG))
            {
                extraData.Add(new string[2] {
                    DotNetScriptEngine.DEBUG, Boolean.TrueString
                });
            }

            return(returnValue);
        }
Esempio n. 2
0
        private static void LoadEngines()
        {
            ZeusConfig           config = ZeusConfig.Current;
            IZeusScriptingEngine engine;

            _engines = new Hashtable();

            engine = new DotNetScript.DotNetScriptEngine();
            _engines.Add(engine.EngineName, engine);

            engine = new MicrosoftScript.MicrosoftScriptEngine();
            _engines.Add(engine.EngineName, engine);

            string   path;
            Assembly assembly;

            foreach (string unparsedpath in config.ScriptingEngines)
            {
                if (unparsedpath.EndsWith("MicrosoftScriptingEngine.dll", StringComparison.CurrentCultureIgnoreCase) ||
                    unparsedpath.EndsWith("DotNetScriptingEngine.dll", StringComparison.CurrentCultureIgnoreCase))
                {
                    continue;
                }
                else
                {
                    path     = FileTools.ResolvePath(unparsedpath, true);
                    assembly = DynamicAssemblyTools.LoadDynamicAssembly(path);

                    if (assembly != null)
                    {
                        object[] tmp = DynamicAssemblyTools.InstantiateClassesByType(assembly, typeof(IZeusScriptingEngine));

                        for (int i = 0; i < tmp.Length; i++)
                        {
                            engine = tmp[i] as IZeusScriptingEngine;

                            if (engine != null)
                            {
                                _engines.Add(engine.EngineName, engine);
                            }
                        }
                    }
                    else
                    {
                        throw new ZeusDynamicException(ZeusDynamicExceptionType.ScriptingEnginePluginInvalid, path);
                    }

                    assembly = null;
                }
            }
        }
using System;
		private static void LoadEngines() 
		{
			ArrayList dllNames = new ArrayList();
			IZeusScriptingEngine engine = new DotNetScriptEngine();

			//TODO:FIX THIS!!!
			string prefix = @"E:\pub\Source Code\MyGeneration\SourceControl\zeus\source\ZeusSolution\ZeusExtremeTest\bin\debug\";

			_engines = new Hashtable();
			_engines.Add(engine.EngineName, engine);

			// Load text File with DLL file names
			if (File.Exists(prefix + ENGINE_CONFIG_FILE)) 
			{
				StreamReader reader = new StreamReader(prefix + ENGINE_CONFIG_FILE, Encoding.UTF8);
				
				string line = reader.ReadLine();
				while (line != null) 
				{
					dllNames.Add(line);
					line = reader.ReadLine();
				}
				reader.Close();
				
				Assembly assembly;
				foreach (string dllPath in dllNames) 
				{
					assembly = DynamicAssemblyTools.LoadDynamicAssembly(prefix +  dllPath);

					if (assembly != null) 
					{
						object[] tmp = DynamicAssemblyTools.InstantiateClassesByType(assembly, typeof(IZeusScriptingEngine));

						for (int i = 0; i < tmp.Length; i++)
						{
							engine = tmp[i] as IZeusScriptingEngine;
						
							if (engine != null)
							{
								_engines.Add(engine.EngineName, engine);
							}
						}
					}
				}
			}
		}
 public DotNetScriptCodeParser(DotNetScriptEngine engine)
 {
     _engine = engine;
 }
Esempio n. 6
0
		private static void LoadEngines() 
		{
			ZeusConfig config = ZeusConfig.Current;
			IZeusScriptingEngine engine;
			_engines = new Hashtable();

            engine = new DotNetScript.DotNetScriptEngine();
            _engines.Add(engine.EngineName, engine);

            engine = new MicrosoftScript.MicrosoftScriptEngine();
            _engines.Add(engine.EngineName, engine);

			string path;
			Assembly assembly;
			foreach (string unparsedpath in config.ScriptingEngines) 
			{
                if (unparsedpath.EndsWith("MicrosoftScriptingEngine.dll", StringComparison.CurrentCultureIgnoreCase) ||
                    unparsedpath.EndsWith("DotNetScriptingEngine.dll", StringComparison.CurrentCultureIgnoreCase))
                {
                    continue;
                }
                else
                {
                    path = FileTools.ResolvePath(unparsedpath, true);
                    assembly = DynamicAssemblyTools.LoadDynamicAssembly(path);

                    if (assembly != null)
                    {
                        object[] tmp = DynamicAssemblyTools.InstantiateClassesByType(assembly, typeof(IZeusScriptingEngine));

                        for (int i = 0; i < tmp.Length; i++)
                        {
                            engine = tmp[i] as IZeusScriptingEngine;

                            if (engine != null)
                            {
                                _engines.Add(engine.EngineName, engine);
                            }
                        }
                    }
                    else
                    {
                        throw new ZeusDynamicException(ZeusDynamicExceptionType.ScriptingEnginePluginInvalid, path);
                    }

                    assembly = null;
                }
			}
		}
Esempio n. 7
0
		public DotNetScriptExecutioner(DotNetScriptEngine engine) 
		{
			this._engine = engine;
		}
 public DotNetScriptExecutioner(DotNetScriptEngine engine)
 {
     this._engine = engine;
 }
Esempio n. 9
0
		public DotNetScriptCodeParser(DotNetScriptEngine engine) 
		{
			_engine = engine;
		}