示例#1
0
            private int GetMemberProperties(int dispid, DispatchPropFlags fetchFlags, out DispatchPropFlags propFlags)
            {
                var member = expandoMembers.FirstOrDefault(testMember => testMember.DispID == dispid);

                if (!member.IsDefault)
                {
                    propFlags =
                        DispatchPropFlags.CanGet |
                        DispatchPropFlags.CanPut |
                        DispatchPropFlags.CannotPutRef |
                        DispatchPropFlags.CannotCall |
                        DispatchPropFlags.CannotConstruct |
                        DispatchPropFlags.CannotSourceEvents;

                    propFlags = propFlags & fetchFlags;
                    return(HResult.S_OK);
                }

                propFlags = 0;
                return(HResult.DISP_E_MEMBERNOTFOUND);
            }
示例#2
0
        public DispatchMember(string name, int dispid, DispatchPropFlags flags)
            : this(name, dispid)
        {
            if (flags.HasFlag(DispatchPropFlags.CanCall))
            {
                DispatchFlags |= DispatchFlags.Method;
            }

            if (flags.HasFlag(DispatchPropFlags.CanGet))
            {
                DispatchFlags |= DispatchFlags.PropertyGet;
            }

            if (flags.HasFlag(DispatchPropFlags.CanPut))
            {
                DispatchFlags |= DispatchFlags.PropertyPut;
            }

            if (flags.HasFlag(DispatchPropFlags.CanPutRef))
            {
                DispatchFlags |= DispatchFlags.PropertyPutRef;
            }
        }