public void AddAssembly(string filePath)
        {
            Tracer.Verbose("AssemblyExplorer:AddAssembly", "Parsing the file {0}", filePath);

            try
            {
                using (new LongOperation(this, "Parsing the assembly"))
                {
                    IAssemblyParser parser = AssemblyParserFactory.GetParser(eParserType.NetParser);
                    NetAssembly     ass    = parser.LoadAssemblyRecursively(filePath);
                    // net assembly or parsing ok
                    if (ass != null)
                    {
                        BindingView.Instance.Workspace.Assemblies.Add(ass);
                        treeViewAss.AddItem(null, ass.Name, ass);
                    }
                }
            }
            catch (Exception err)
            {
                Tracer.Error("AssemblyExplorer.AddAssembly", err);
            }
            finally
            {
                Tracer.Verbose("AssemblyExplorer:AddAssembly", "END");
            }
        }
Exemplo n.º 2
0
        private void DoParsingWork(object sender, DoWorkEventArgs e)
        {
            Tracer.Verbose("AssemblyBackgroundWorkerParser:DoParsingWork", "START");
            try
            {
                IAssemblyParser parser = AssemblyParserFactory.GetParser(_ParserType);
                e.Result = parser.LoadAssemblyRecursively((string)e.Argument);
            }
            catch (Exception err)
            {
                Tracer.Error("AssemblyBackgroundWorkerParser.DoParsingWork", err);
            }
            finally
            {
                Tracer.Verbose("AssemblyBackgroundWorkerParser:DoParsingWork", "END");

                //be sure progress is stoped
                EventDispatcher.Instance.RaiseStatus("", StatusEventType.StopProgress);
            }
        }