Example #1
0
            //private Callback mCallback;
            //private VariantClosure mCallbackClosure;
            // a class to receive member callback from class
            // destination object
            /// <exception cref="VariantException"></exception>
            /// <exception cref="TjsException"></exception>
            public override int FuncCall(int flag, string membername, Variant result, Variant
                                         [] param, Dispatch2 objthis)
            {
                // *param[0] = name   *param[1] = flags   *param[2] = value
                int flags = param[1].AsInteger();

                if ((flags & Interface.STATICMEMBER) == 0)
                {
                    Variant val = new Variant(param[2]);
                    if (val.IsObject())
                    {
                        // change object's objthis if the object's objthis is null
                        if (val.AsObjectThis() == null)
                        {
                            val.ChangeClosureObjThis(mDest);
                        }
                    }
                    mDest.PropSet(Interface.MEMBERENSURE | Interface.IGNOREPROP | flags, param[0].AsString
                                      (), val, mDest);
                }
                if (result != null)
                {
                    result.Set(1);
                }
                // returns true
                return(Error.S_OK);
            }