Example #1
0
        public ObjectInspector(object comObject)
        {
            System.Runtime.InteropServices.ComTypes.ITypeLib ppTLB = null;
            int pIndex = 0;

            _dispatch = comObject as IDispatch;


            if (_dispatch != null)
            {
                _object   = comObject;
                _typeInfo = _dispatch.GetTypeInfo(0, 0);
                _typeInfo.GetTypeAttr(out _pTypeAttr);
                _typeInfo.GetDocumentation(-1,
                                           out _typeName,
                                           out _typeDescription,
                                           out _typeHelpContext,
                                           out _typeHelpFile);
                _typeInfo.GetContainingTypeLib(out ppTLB, out pIndex);
                _comTypeLibrary = new ComTypeLibrary(ppTLB);
            }
            else
            {
                throw new InvalidComObjectException();
            }
        }
Example #2
0
        public override bool Equals(object obj)
        {
            ComTypeLibrary comTypeLibrary = obj as ComTypeLibrary;

            if (comTypeLibrary != null)
            {
                if (this.TypeLibAttr.guid.Equals(comTypeLibrary.TypeLibAttr.guid))
                {
                    if (this.TypeLibAttr.wMajorVerNum.Equals(comTypeLibrary.TypeLibAttr.wMajorVerNum))
                    {
                        if (this.TypeLibAttr.wMinorVerNum.Equals(comTypeLibrary.TypeLibAttr.wMinorVerNum))
                        {
                            return(true);
                        }
                    }
                }
                return(base.Equals(obj));
            }
            else
            {
                return(base.Equals(obj));
            }
        }