/// <exception cref="VariantException"></exception>
 /// <exception cref="TjsException"></exception>
 public virtual bool Callback(string name, int flags, Variant value)
 {
     // hidden members are not copied
     if ((flags & Interface.HIDDENMEMBER) != 0)
     {
         return(true);
     }
     mOwner.PropSet(Interface.MEMBERENSURE | Interface.IGNOREPROP | flags, name, value
                    , mOwner);
     return(true);
 }
        /// <exception cref="VariantException"></exception>
        /// <exception cref="TjsException"></exception>
        public virtual void Assign(Dispatch2 dsp, bool clear)
        {
            // copy members from "dsp" to "Owner"
            // determin dsp's object type
            ArrayNI      arrayni = null;
            CustomObject owner   = mOwner.Get();

            if (dsp != null && (arrayni = (ArrayNI)dsp.GetNativeInstance(ArrayClass.ClassID))
                != null)
            {
                // convert from array
                if (clear)
                {
                    owner.Clear();
                }
                int count = arrayni.mItems.Count;
                for (int i = 0; i < count; i++)
                {
                    Variant v    = arrayni.mItems[i];
                    string  name = v.AsString();
                    i++;
                    if (i >= count)
                    {
                        break;
                    }
                    Variant v2 = arrayni.mItems[i];
                    owner.PropSet(Interface.MEMBERENSURE | Interface.IGNOREPROP, name, v2, owner);
                }
            }
            else
            {
                // otherwise
                if (clear)
                {
                    owner.Clear();
                }
                DictionaryNI.AssignCallback callback = new DictionaryNI.AssignCallback(owner);
                dsp.EnumMembers(Interface.IGNOREPROP, callback, dsp);
            }
        }