Пример #1
0
        /// <summary>
        /// Execute tie script statements with Host instance synchronized,and CodeBlock is resident
        /// keyword this in the script pointer to host instance
        /// </summary>
        /// <param name="src">source code</param>
        /// <param name="instance">Host instance</param>
        public void Execute(string src, object instance)
        {
            //支持this操作符,但是this.xxx只能是public成员
            this.scope = "THIS";
            DS.AddObject(this.scope, instance);

            SyncInstance(instance, false);
            Execute(src, CodeType.statements, CodeMode.Append);       //缺省: 保留statements的代码在module上面
            SyncInstance(instance, true);
        }