public async void AddExistingRamlFromDisk() { SelectExistingRamlOption(); FileDialog fd = new OpenFileDialog(); fd.DefaultExt = ".raml;*.rml"; fd.Filter = "RAML files |*.raml;*.rml"; var opened = fd.ShowDialog(); if (opened != true) { return; } RamlTempFilePath = fd.FileName; RamlOriginalSource = fd.FileName; var previewViewModel = new RamlPreviewViewModel(ServiceProvider, action, RamlTempFilePath, RamlOriginalSource, Path.GetFileName(fd.FileName), isContractUseCase); StartProgress(); await previewViewModel.FromFile(); StopProgress(); ShowPreviewViewAndClose(previewViewModel); }
public void AddNewContract() { var previewViewModel = new RamlPreviewViewModel(ServiceProvider, action, Title); previewViewModel.NewContract(); dynamic settings = new ExpandoObject(); settings.Height = 420; WindowManager.ShowDialog(previewViewModel, null, settings); TryClose(); }
public async void AddExistingRamlFromUrl() { SelectExistingRamlOption(); var previewViewModel = new RamlPreviewViewModel(ServiceProvider, action, RamlTempFilePath, Url, "title", isContractUseCase); StartProgress(); await previewViewModel.FromUrl(); StopProgress(); ShowPreviewViewAndClose(previewViewModel); }
private void ShowPreviewViewAndClose(RamlPreviewViewModel previewViewModel) { dynamic settings = new ExpandoObject(); settings.Height = isContractUseCase ? 660 : 480; WindowManager.ShowDialog(previewViewModel, null, settings); if (previewViewModel.WasImported) { TryClose(); } }
public async void AddExistingRamlFromExchange() { SelectExistingRamlOption(); var rmlLibrary = new RAMLLibraryBrowser(exchangeUrl); var selectedRamlFile = rmlLibrary.ShowDialog(); if (selectedRamlFile.HasValue && selectedRamlFile.Value) { var url = rmlLibrary.RAMLFileUrl; Url = url; var previewViewModel = new RamlPreviewViewModel(ServiceProvider, action, RamlTempFilePath, url, "title", isContractUseCase); StartProgress(); await previewViewModel.FromUrl(); StopProgress(); ShowPreviewViewAndClose(previewViewModel); } }