public void EngineExecuteCode(IZeusCodeSegment segment, IZeusContext context)
        {
            bool assemblyLoaded = false;

            try
            {
                this.Cleanup();
                this._codeSegment = segment;

                assemblyLoaded = this.LoadAssembly(context);
                if (assemblyLoaded && !HasErrors)
                {
                    this._currentObject = InstantiateClass(CurrentAssembly, typeof(_DotNetScriptTemplate), context);

                    if (this._currentObject is _DotNetScriptTemplate)
                    {
                        this._primaryObject = this._currentObject as _DotNetScriptTemplate;
                        this._primaryObject.Render();
                    }
                    this._assemblyStack.Pop();
                    assemblyLoaded = false;
                }
            }
            catch (Exception ex)
            {
                this.Cleanup(assemblyLoaded);
                log.Error(ex);
                throw ex;
            }
        }
Beispiel #2
0
 override public void Cleanup()
 {
     this._currentAssembly = null;
     this._interfaceObject = null;
     this._primaryObject   = null;
     this._currentObject   = null;
 }
        protected void Cleanup(bool newAssemblyCreated)
        {
            _primaryObject   = null;
            _interfaceObject = null;
            _currentObject   = null;

            if (newAssemblyCreated)
            {
                this._assemblyStack.Pop();
            }
        }
Beispiel #4
0
        override protected void EngineExecuteCode(ZeusCodeSegment segment, ZeusTemplateContext context)
        {
            try
            {
                this.Cleanup();
                this._codeSegment = segment;

                this._currentObject = InstantiateClass(this.CurrentAssembly, typeof(_DotNetScriptTemplate), context);

                if (this._currentObject is _DotNetScriptTemplate)
                {
                    this._primaryObject = this._currentObject as _DotNetScriptTemplate;
                    this._primaryObject.Render();
                }
            }
            catch (ZeusCompilerException ex)
            {
                ex.IsTemplateScript = true;
                throw ex;
            }
        }
		public void EngineExecuteCode(IZeusCodeSegment segment, IZeusContext context)
		{
			bool assemblyLoaded = false;
			try 
			{
				this.Cleanup();
				this._codeSegment = segment;
			
				assemblyLoaded = this.LoadAssembly(context);
				if (assemblyLoaded && !HasErrors) 
				{
					this._currentObject = InstantiateClass( CurrentAssembly, typeof(_DotNetScriptTemplate), context );

					if (this._currentObject is _DotNetScriptTemplate)
					{
						this._primaryObject = this._currentObject as _DotNetScriptTemplate;
						this._primaryObject.Render();
					}
					this._assemblyStack.Pop();
					assemblyLoaded = false;
				}
			}
			catch (Exception ex)
			{
				this.Cleanup( assemblyLoaded );
				throw ex;
			}
        }
		protected void Cleanup(bool newAssemblyCreated) 
		{
			_primaryObject = null;
			_interfaceObject = null;
			_currentObject = null;
			
			if (newAssemblyCreated)
			{
				this._assemblyStack.Pop();
			}
		}
		override public void Cleanup() 
		{
			this._currentAssembly = null;
			this._interfaceObject = null;
			this._primaryObject = null;
			this._currentObject = null;
		}
		override protected void EngineExecuteCode(ZeusCodeSegment segment, ZeusTemplateContext context)
		{
			try 
			{
				this.Cleanup();
				this._codeSegment = segment;
			
				this._currentObject = InstantiateClass( this.CurrentAssembly, typeof(_DotNetScriptTemplate), context );

				if (this._currentObject is _DotNetScriptTemplate)
				{
					this._primaryObject = this._currentObject as _DotNetScriptTemplate;
					this._primaryObject.Render();
				}
			}
			catch (ZeusCompilerException ex)
			{
				ex.IsTemplateScript = true;
				throw ex;
			}
		}