Esempio n. 1
0
        private void DependencyFindBtn_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(DependencyPathSelector.Path))
            {
                return;
            }

            try
            {
                AssemblyLister lister = new AssemblyLister(DependencyPathSelector.Path);
                lister.OnAssembliesLoad    += new AssemblyLister.AllAssembliesLoad(Dependencies_OnAssembliesLoad);
                lister.OnAssemblyProcessed += new AssemblyLister.AssemblyProcessed(Dependencies_OnAssemblyProcessed);
                lister.CreateAssembliesInfo();
                List <AssemblyName> assemblies = lister.FindAssembliesThatReference(DependencyAssNameTB.Text, DependencyAssVersionTB.Text);
                if (assemblies != null && assemblies.Count > 0)
                {
                    FolderAssemblyList dialog = new FolderAssemblyList();
                    dialog.Text       = GetAssemblyListString(DependencyPathSelector.Path);
                    dialog.Assemblies = assemblies.ToWikiStrings();
                    dialog.Show();
                }
                else
                {
                    MessageBox.Show("Specified assembly not found in references.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Cannot access path.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
        }
Esempio n. 2
0
        private void AssListShowBtn_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(AssListPathSelector.Path))
            {
                return;
            }

            try
            {
                AssemblyLister lister = new AssemblyLister(AssListPathSelector.Path);
                lister.OnAssembliesLoad    += new AssemblyLister.AllAssembliesLoad(lister_OnAssembliesLoad);
                lister.OnAssemblyProcessed += new AssemblyLister.AssemblyProcessed(lister_OnAssemblyLoad);
                lister.CreateAssembliesInfo();

                if (lister.Assemblies.Count < 1)
                {
                    MessageBox.Show("This folder does not contain .NET libraries.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                FolderAssemblyList dialog = new FolderAssemblyList();
                dialog.Text       = GetAssemblyListString(AssListPathSelector.Path);
                dialog.Assemblies = lister.GetNamesWithVersion();
                dialog.Show();
            }
            catch (Exception)
            {
                MessageBox.Show("Cannot access path.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
        }