コード例 #1
0
        /// <summary>
        /// Gets a reference to an extensible application
        /// </summary>
        /// <param name="name">
        /// Name of the application
        /// </param>
        /// <param name="searchPaths">
        /// Custom paths where to look for the application.
        /// </param>
        /// <returns>
        /// The Application object. Null if not found.
        /// </returns>
        public static Application GetExtensibleApplication(string name, IEnumerable <string> searchPaths)
        {
            AddinsPcFileCache pcc = GetAddinsPcFileCache(searchPaths);
            PackageInfo       pi  = pcc.GetPackageInfoByName(name, searchPaths);

            if (pi != null)
            {
                return(new Application(pi));
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
        /// <summary>
        /// Gets a lis of all known extensible applications
        /// </summary>
        /// <param name="searchPaths">
        /// Custom paths where to look for applications.
        /// </param>
        /// <returns>
        /// A list of applications.
        /// </returns>
        public static Application[] GetExtensibleApplications(IEnumerable <string> searchPaths)
        {
            List <Application> list = new List <Application> ();

            AddinsPcFileCache pcc = GetAddinsPcFileCache(searchPaths);

            foreach (PackageInfo pinfo in pcc.GetPackages(searchPaths))
            {
                if (pinfo.IsValidPackage)
                {
                    list.Add(new Application(pinfo));
                }
            }
            return(list.ToArray());
        }
コード例 #3
0
 static AddinsPcFileCache GetAddinsPcFileCache(IEnumerable <string> searchPaths)
 {
     if (pcFileCache == null)
     {
         pcFileCache = new AddinsPcFileCache();
         if (searchPaths != null)
         {
             pcFileCache.Update(searchPaths);
         }
         else
         {
             pcFileCache.Update();
         }
     }
     return(pcFileCache);
 }
コード例 #4
0
ファイル: SetupService.cs プロジェクト: NALSS/Telegraph
 static AddinsPcFileCache GetAddinsPcFileCache(IEnumerable<string> searchPaths)
 {
     if (pcFileCache == null) {
         pcFileCache = new AddinsPcFileCache ();
         if (searchPaths != null)
             pcFileCache.Update (searchPaths);
         else
             pcFileCache.Update ();
     }
     return pcFileCache;
 }