Ejemplo n.º 1
0
        private void DoRegistration(bool install)
        {
            try
            {
                // register/unregister the component
                GoogleDesktopRegistrar gdsReg = new GoogleDesktopRegistrar();

                if (install)
                {
                    // register with GDS
                    object[] componentDesc = new object[6] {
                        "Title", _name,
                        "Description", _description,
                        "Icon", _icon
                    };
                    gdsReg.StartComponentRegistration(_componentGuid, componentDesc);
                    IGoogleDesktopRegisterIndexingPlugin indexReg
                        = (IGoogleDesktopRegisterIndexingPlugin)gdsReg.GetRegistrationInterface(IndexingRegistrarID);
                    indexReg.RegisterIndexingPlugin(null);
                    gdsReg.FinishComponentRegistration();
                }
                else
                {
                    gdsReg.UnregisterComponent(_componentGuid);
                }
            }
            catch (COMException e)
            {
                throw new GoogleDesktopException(e);
            }
        }
Ejemplo n.º 2
0
        private void DoRegistration(bool install)
        {
            try
            {
                // register/unregister the component
                GoogleDesktopRegistrar gdsReg = new GoogleDesktopRegistrar();

                if (install)
                {
                    // register with GDS
                    object[] componentDesc = new object[6] {
                                                      "Title", _name,
                                                      "Description", _description,
                                                      "Icon", _icon
                                                    };
                    gdsReg.StartComponentRegistration(_componentGuid, componentDesc);
                    IGoogleDesktopRegisterIndexingPlugin indexReg
                        = (IGoogleDesktopRegisterIndexingPlugin)gdsReg.GetRegistrationInterface(IndexingRegistrarID);
                    indexReg.RegisterIndexingPlugin(null);
                    gdsReg.FinishComponentRegistration();
                }
                else
                {
                    gdsReg.UnregisterComponent(_componentGuid);
                }
            }
            catch (COMException e)
            {
                throw new GoogleDesktopException(e);
            }
        }