public S365File ShowSaveDialog(List <string> fileFormats = null) { var navigationPath = "filepicker/save"; var queryParams = new Dictionary <string, string>(); if (fileFormats != null && fileFormats.Count > 0) { queryParams.Add("extensions", string.Join("_", fileFormats)); } if (!string.IsNullOrWhiteSpace(SuggestedDirectory)) { queryParams.Add("directory", HttpUtility.UrlEncode(SuggestedDirectory)); } if (!string.IsNullOrWhiteSpace(SuggestedFilename)) { queryParams.Add("filename", HttpUtility.UrlEncode(SuggestedFilename)); } var initialUrl = $"{navigationPath}"; if (queryParams.Any()) { initialUrl = initialUrl + string.Join("", queryParams.Select(x => { var param = $"{x.Key}={x.Value}"; return(queryParams.First().Key == x.Key ? $"?{param}" : $"&{param}"); }).ToList()); } string title = "Save file to Simulate 365 Dashboard"; _webUIForm = new WebUIForm(initialUrl, title, true) { Width = 1300, Height = 800 }; _webUIForm.SubscribeToInitializationCompleted(Browser_CoreWebView2InitializationCompleted); _webUIForm.ShowDialog(); return(_filePickerService.SelectedSaveFile != null ? new S365File(null) { DriveId = _filePickerService.SelectedSaveFile.FlowsheetsDriveId, FileId = null, Filename = _filePickerService.SelectedSaveFile.Filename, ParentDriveId = _filePickerService.SelectedSaveFile.ParentDriveId, FullPath = _filePickerService.SelectedSaveFile.SimulatePath } : null); }
public LoginForm() { _authService = new AuthService(); _authService.OnNavigateToLoginPage += (s, e) => RedirectToLoginPage(); var initalUrl = GetLoginPageUrl(); var useLocalUI = false; if (!IsProVersion()) { initalUrl = "login/intro"; useLocalUI = true; } _webUIForm = new WebUIForm(initalUrl, "Login with Simulate 365 account", useLocalUI) { Width = 500, Height = 600 }; _webUIForm.SubscribeToNavigationStarting(WebView_NavigationStarting); _webUIForm.SubscribeToInitializationCompleted(Browser_CoreWebView2InitializationCompleted); }