示例#1
0
        public override ktValue _RunMethod(ktString Name, ktList Arguments)
        {
            if (Name.IsEmpty())
            {
                throw new ktError("Didn't get the name of the method to run in class '" +
                                m_Name + "'.", ktERR.NOTSET);
            }
            //ktDebug.Log( ";Name::"+ Name + ";;;;_\n" );
            if (Name == "_PropertyChanged")
            {
                if ((Arguments == null) || (Arguments.GetCount() != 2))
                {
                    throw new ktError("kactalk::_PropertyChanged() : Didn't get the two nnede arguments!",
                                      ktERR.MISSING);
                }
            #if Debug
            ktDebug.Log( "Args::" + Arguments.Get_R( "\t", true ) );
            #endif

                Name = Arguments.Get("Name").Node.Value.ToString();
                ktValue Value = (ktValue)Arguments.Get("Value").Node.Value;

                SetProperty(Name, Value);

                return ktValue.Null;
            }
            else /*if (Name.StartsWith( "operator", out Name )) {
                return HandleOperator( Name, Arguments );
            } else */
            {
                throw new ktError("Couldn't find the method '" +
                                  Name + "' in class '" + m_Name + "'.", ktERR._404);
            }
        }