コード例 #1
0
        private void BuildPackageInfoList()
        {
            List <PackageInfo> list = new List <PackageInfo>();

            foreach (string file in Directory.GetFiles(Utilities.GetWorkingDirectory()).Where(f => f.EndsWith(".dll") || f.EndsWith(".exe")))
            {
                try
                {
                    Assembly asm = Assembly.LoadFile(file);

                    AlarmWorkflowPackageAttribute attribute = null;
                    if (!AlarmWorkflowPackageAttribute.TryGetAttribute(asm, out attribute))
                    {
                        continue;
                    }

                    list.Add(PackageInfo.FromAssembly(asm));
                }
                catch
                {
                    // Intentionally left empty
                }
            }

            InstalledPackagesInfo = new List <PackageInfo>(list.OrderBy(i => i.Name));
        }