public void DynamicCodeCoupling(IDynamicCode parent, string path) { if (parent is DnnDynamicCode isDynCode) { DynCode = isDynCode; } }
public void DynamicCodeCoupling(IDynamicCode parent) { var wrapLog = Log.Call(); var parentIsDynCode = false; if (parent is DnnDynamicCodeRoot isDynCode) { DynCode = isDynCode; parentIsDynCode = true; } wrapLog(parentIsDynCode.ToString()); }
public void DynamicCodeCoupling(IDynamicCode parent) { if (!(parent is DnnDynamicCodeRoot isDynCode)) { return; } DynCode = isDynCode; _log = new Log("Rzr.Comp", DynCode?.Log); var wrapLog = Log.Call(); wrapLog("ok"); }
public void CompileTest() { IDynamicCode compiledCode = Compiler <IDynamicCode> .Compile("testAssembly", @" namespace Xutils.DynamicCode.Tests { public class TestClass : IDynamicCode { public string ParseString(string input) { return $""Input was: { input}""; } } }"); string output = compiledCode.ParseString("this is the input"); Assert.AreEqual("Input was: this is the input", output); }