public IFilter CreateSafeFilter(RenderChain chain, IFilter input)
 {
     DisposeHelper.Dispose(ref m_TextFilter);
     try
     {
         return Chain.CreateFilter(input);
     }
     catch (Exception ex)
     {
         return DisplayError(ex);
     }
 }
 public bool Evaluate(RenderChain.RenderChain chain, IFilter input, string code, string filename = "")
 {
     try
     {
         ResetEngine(chain, input);
         dynamic result = m_Engine.Evaluate("RenderScript", true, code);
         return result is bool ? result : false;
     }
     catch (ScriptEngineException e)
     {
         ThrowScriptEngineException(filename, e);
     }
     return false;
 }
 private IClip ResetEngine(RenderChain.RenderChain chain, IFilter input)
 {
     m_Engine.CollectGarbage(true);
     var mock = (chain == null || input == null);
     var clip = mock ? (IClip) new MockClip() : new Clip(chain, input);
     AssignScriptObjects(clip);
     return mock ? null : clip;
 }
 public IFilter Execute(RenderChain.RenderChain chain, IFilter input, string code, string filename = "")
 {
     try
     {
         var clip = ResetEngine(chain, input);
         m_Engine.Execute("RenderScript", true, code);
         return clip == null ? null : ((Clip) clip).Filter;
     }
     catch (ScriptEngineException e)
     {
         ThrowScriptEngineException(filename, e);
     }
     return null;
 }
 public RenderChainScript(RenderChain chain)
 {
     Chain = chain;
     Chain.Initialize();
 }
示例#6
0
 public RenderChainScript(RenderChain chain)
 {
     Chain = chain;
     Chain.Initialize();
     Status = string.Empty;
 }