Exemplo n.º 1
0
        public T GetDnlibType <T>(ITreeViewNodeFilter filter, T selectedObject, ModuleDef ownerModule) where T : class
        {
            var data = new MemberPickerVM(MainWindow.Instance.CurrentLanguage, filter, MainWindow.Instance.CurrentAssemblyList.GetAssemblies());
            var win  = new MemberPickerDlg();

            win.DataContext = data;
            win.Owner       = ownerWindow ?? MainWindow.Instance;
            data.SelectItem(selectedObject);
            if (win.ShowDialog() != true)
            {
                return(null);
            }

            return(ImportObject(ownerModule, data.SelectedDnlibObject) as T);
        }
Exemplo n.º 2
0
        public T GetDnlibType <T>(string title, IDocumentTreeNodeFilter filter, T selectedObject, ModuleDef ownerModule) where T : class
        {
            var newDocumentTreeView = documentTreeViewProvider.Create(filter);

            try {
                var win  = new MemberPickerDlg(documentTreeView, newDocumentTreeView);
                var data = new MemberPickerVM(fileSearcherProvider, newDocumentTreeView, decompilerService, filter, title, documentTreeView.DocumentService.GetDocuments());
                data.SyntaxHighlight = documentTreeViewSettings.SyntaxHighlight;
                win.DataContext      = data;
                win.Owner            = ownerWindow ?? appWindow.MainWindow;
                data.SelectItem(selectedObject);
                if (win.ShowDialog() != true)
                {
                    return(null);
                }

                return(ImportObject(ownerModule, data.SelectedDnlibObject) as T);
            }
            finally {
                newDocumentTreeView.Dispose();
            }
        }
Exemplo n.º 3
0
        public T GetDnlibType <T>(string title, IFileTreeNodeFilter filter, T selectedObject, ModuleDef ownerModule) where T : class
        {
            var newFileTreeView = fileTreeViewCreator.Create(filter);

            try {
                var data = new MemberPickerVM(fileSearcherCreator, newFileTreeView, languageManager, filter, title, fileTreeView.FileManager.GetFiles());
                data.SyntaxHighlight = fileTreeViewSettings.SyntaxHighlight;
                var win = new MemberPickerDlg(fileTreeView, newFileTreeView, imageManager);
                win.DataContext = data;
                win.Owner       = ownerWindow ?? appWindow.MainWindow;
                data.SelectItem(selectedObject);
                if (win.ShowDialog() != true)
                {
                    return(null);
                }

                return(ImportObject(ownerModule, data.SelectedDnlibObject) as T);
            }
            finally {
                newFileTreeView.Dispose();
            }
        }