Beispiel #1
0
        public DTE_Addin FindAddinByGuid(string InGuid)
        {
            EnvDTE.AddIns addins     = dte2.AddIns;
            EnvDTE.AddIn  foundAddin = null;

            foreach (AddIn addin in dte2.AddIns)
            {
                if (addin.Guid == InGuid)
                {
                    foundAddin = addin;
                    break;
                }
            }

            if (foundAddin == null)
            {
                return(null);
            }
            else
            {
                return(new DTE_Addin(this, foundAddin));
            }
        }
Beispiel #2
0
        public DTE_Addin FindAddin(string InProgId)
        {
            EnvDTE.AddIns addins     = dte2.AddIns;
            EnvDTE.AddIn  foundAddin = null;

            try
            {
                foundAddin = addins.Item(InProgId);
            }
            catch (Exception)
            {
                foundAddin = null;
            }

            if (foundAddin == null)
            {
                return(null);
            }
            else
            {
                return(new DTE_Addin(this, foundAddin));
            }
        }