Exemple #1
0
        internal void LoadApplication(string path)
        {
            Cleanup();

            m_xap   = new XAP(path);
            m_hooks = new List <MethodHook>();

            var context = TaskScheduler.FromCurrentSynchronizationContext();

            Task.Factory.StartNew(() =>
            {
                m_xap.Parse();
                foreach (var xapAssembly in m_xap.Assemblies)
                {
                    FillAssemblyMethods(xapAssembly);
                }
                ResetButton("deploy");
                m_view.SetManifestInformation(m_xap);

                UnsubscribeTreeModelEvents();
                m_treeModel  = new AssemblyTreeModel();
                var rootNode = new Node(m_xap.Title);
                m_treeModel.Nodes.Add(rootNode);

                foreach (var assembly in m_xap.Assemblies)
                {
                    var assemblyNode = new AssemblyNode(new FileInfo(assembly.AssemblyPath).Name);
                    rootNode.Nodes.Add(assemblyNode);
                    ProcessAssemblyNodeToTree(assemblyNode, assembly);
                }

                m_view.SetTreeModel(m_treeModel);
                m_view.SetExpanded(rootNode);

                Thread.Sleep(50);

                SubscribeTreeModelEvents();
            }
                                  ).ContinueWith(t =>
            {
                if (t.IsFaulted)
                {
                    HandleError(t.Exception.InnerException);
                }
            },
                                                 context
                                                 );
        }
Exemple #2
0
        internal void LoadApplication(string path)
        {
            Cleanup();

            m_xap = new XAP(path);
            m_hooks = new List<MethodHook>();

            var context = TaskScheduler.FromCurrentSynchronizationContext();

            Task.Factory.StartNew(() =>
                {
                    m_xap.Parse();
                    foreach (var xapAssembly in m_xap.Assemblies)
                    {
                        FillAssemblyMethods(xapAssembly);
                    }
                    ResetButton("deploy");
                    m_view.SetManifestInformation(m_xap);

                    UnsubscribeTreeModelEvents();
                    m_treeModel = new AssemblyTreeModel();
                    var rootNode = new Node(m_xap.Title);
                    m_treeModel.Nodes.Add(rootNode);

                    foreach (var assembly in m_xap.Assemblies)
                    {
                        var assemblyNode = new AssemblyNode(new FileInfo(assembly.AssemblyPath).Name);
                        rootNode.Nodes.Add(assemblyNode);
                        ProcessAssemblyNodeToTree(assemblyNode, assembly);
                    }

                    m_view.SetTreeModel(m_treeModel);
                    m_view.SetExpanded(rootNode);

                    Thread.Sleep(50);

                    SubscribeTreeModelEvents();
                }
            ).ContinueWith(t =>
                {
                    if (t.IsFaulted)
                    {
                        HandleError(t.Exception.InnerException);
                    }
                },
                context
            );
        }