Пример #1
0
        public void Initialize()
        {
            AssemblyReader asmInfoProcessor = new AssemblyReader();

            result        = asmInfoProcessor.Read(dllPath);
            testClassType = typeof(TestClass);
        }
Пример #2
0
        private async void OpenFile()
        {
            var assemblyFileType = new FileType(".NET Assembly (*.dll, *.exe)", ".dll;*.exe");
            var allFileType      = new FileType("All files (*.*)", ".*");
            var result           = fileDialogService.ShowOpenFileDialog(ShellViewModel.View, new[] { assemblyFileType, allFileType });

            if (!result.IsValid)
            {
                return;
            }

            try
            {
                using (ShellViewModel.SetApplicationBusy())
                {
                    var assemblyApi = await Task.Run(() => AssemblyReader.Read(result.FileName));

                    AddAndSelectAssemblyApi(result.FileName, assemblyApi.version, assemblyApi.api);
                }
            }
            catch (Exception e)
            {
                messageService.ShowError(ShellViewModel.View, "Could not read the file. Error: " + e);
            }
        }
Пример #3
0
        private async Task OpenFromNuget()
        {
            using (var controller = openFromNugetController.CreateExport())
            {
                var result = await controller.Value.RunAsync(ShellViewModel.View);

                if (result.assemblyStream == null)
                {
                    return;
                }
                using (ShellViewModel.SetApplicationBusy())
                {
                    var assemblyApi = await Task.Run(() => AssemblyReader.Read(result.assemblyStream, null));

                    AddAndSelectAssemblyApi(result.fileName, assemblyApi.version, assemblyApi.api);
                }
            }
        }