Ejemplo n.º 1
0
        public void IsDataTest1()
        {
            IPM pm = new PM("pname . m1(true, 123).right = true");

            Assert.AreEqual(true, pm.IsData("pname"));
            Assert.AreEqual(false, pm.IsData("pname "));
            pm.pinTo(1);

            Assert.AreEqual(true, pm.IsData("m1"));
            pm.pinTo(1);

            Assert.AreEqual(true, pm.IsData("right"));
            pm.pinTo(1);

            Assert.AreEqual(true, pm.IsData(" true"));
        }
Ejemplo n.º 2
0
        public void IsDataTest2()
        {
            IPM pm = new PM("pname = true");

            Assert.AreEqual(false, pm.IsData("property1", "property2", "property2", "property3"));
            Assert.AreEqual(true, pm.IsData("property1", "property2", "pname", "property3"));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Handler for current data
        /// </summary>
        /// <param name="data">mixed data</param>
        /// <returns>prepared and evaluated data</returns>
        public override string parse(string data)
        {
            var point       = entryPoint(data, RegexOptions.Singleline);
            string subtype  = point.Key;
            string request  = point.Value;

            Log.Trace("`{0}`: subtype - `{1}`, request - `{2}`", ToString(), subtype, request);

            IPM pm = new PM(request, msbuild);

            if(pm.IsData("get")) {
                return stGet(pm);
            }
            if(pm.IsData("call", "out", "scall", "sout", "cmd")) {
                return stCallFamily(pm);
            }
            if(pm.IsData("write", "append", "writeLine", "appendLine")) {
                return stWriteFamily(pm);
            }
            if(pm.IsData("replace")) {
                return stReplace(pm);
            }
            if(pm.IsData("exists")) {
                return stExists(pm);
            }
            if(pm.IsData("remote")) {
                return stRemote(pm);
            }
            if(pm.IsData("copy")) {
                return stCopy(pm);
            }
            if(pm.IsData("delete")) {
                return stDelete(pm);
            }

            throw new IncorrectNodeException(pm);
        }