Exemplo n.º 1
0
        private void LoadAssembly()
        {
            if (string.IsNullOrWhiteSpace(this.assemblyPath) == false)
            {
                if (File.Exists(this.assemblyPath) == false)
                {
                    MessageBox.Show($"The assembly info couldn't be loaded, the path \"{ Path.GetFullPath(this.assemblyPath) }\" doesn't exist.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    this.ClearForm();

                    this.assemblyInformationLoader = new AssemblyInformationLoader(this.assemblyPath);
                    this.assemblyInformation       = this.assemblyInformationLoader.GetAssemblyInformation(this.assemblyPath);
                    this.SetAssemblyInformation(this.assemblyInformation);

                    Task.Run(() =>
                    {
                        try
                        {
                            this.InvokeIfRequired(() => this.Cursor = Cursors.WaitCursor);
                            this.SuspendLayout();

                            this.AddAssemblyReferenceNodes(this.treeViewReferences.Nodes, this.assemblyInformation.ReferencedAssemblies);
                        }
                        finally
                        {
                            this.ResumeLayout();
                            this.InvokeIfRequired(() => this.Cursor = Cursors.Default);
                        }
                    });
                }
            }
        }
 public FormMain(Assembly assemb)
 {
     InitializeComponent();
     _mAssembly          = assemb;
     assemblyInformation = new AssemblyInformationLoader(assemb);
     referringAssemblyFolderTextBox.Text = Path.GetDirectoryName(_mAssembly.Location);
     AssemblyFormMap[assemb.FullName]    = this;
     FormClosing += FormMainFormClosing;
 }