Example #1
0
 public void DynamicCodeCoupling(IDynamicCode parent, string path)
 {
     if (parent is DnnDynamicCode isDynCode)
     {
         DynCode = isDynCode;
     }
 }
Example #2
0
        public void DynamicCodeCoupling(IDynamicCode parent)
        {
            var wrapLog         = Log.Call();
            var parentIsDynCode = false;

            if (parent is DnnDynamicCodeRoot isDynCode)
            {
                DynCode         = isDynCode;
                parentIsDynCode = true;
            }
            wrapLog(parentIsDynCode.ToString());
        }
Example #3
0
        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");
        }
Example #4
0
        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);
        }