Beispiel #1
0
        public static LicenseInfo[] GetLicenses()
        {
            String dir = GetLicensesPath();
            Dictionary <Guid, LicenseInfo> licenses = new Dictionary <Guid, LicenseInfo>();

            if (System.IO.Directory.Exists(dir))
            {
                foreach (String lFile in System.IO.Directory.EnumerateFiles(dir))
                {
                    try
                    {
                        LicenseInfo li = GetLicenseInfo(lFile);
                        if (!licenses.ContainsKey(li.Id))
                        {
                            licenses.Add(li.Id, li);
                        }
                    }
                    catch (Exception ex)
                    {
                        Trace.TraceError("Exception in GetLicenses: {0}", Utils.MakeDetailedExceptionString(ex));
                    }
                }
            }
            return(licenses.Values.ToArray <LicenseInfo>());
        }