AjScript.Language.Function.GetValue C# (CSharp) Method

GetValue() public method

public GetValue ( string name ) : object
name string
return object
        public override object GetValue(string name)
        {
            if (name == "length")
                return this.parameterNames.Length;

            return base.GetValue(name);
        }

Usage Example

示例#1
0
        public void FunctionLength()
        {
            ICommand body = new ReturnCommand(new VariableExpression("x"));
            Function function = new Function(new string[] { "x" }, body);

            object result = function.GetValue("length");

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result);
        }
All Usage Examples Of AjScript.Language.Function::GetValue