private async void ucConnectButton_Click(object sender, RoutedEventArgs e) { Telemetry.Instance.Native.TrackEvent("Connect.OK", new Dictionary<string, string> { {"ProviderType", Model.ProviderType.ToString() }, {"UseCurrentUser", Model.UseCurrentUser.ToString() } }); var client = SharePointProviderFactory.Create(Model.ProviderType); try { Model.IsConnecting = true; StatusNotification.NotifyWithProgress("Connecting..."); var userName = !Model.UseCurrentUser ? Model.UserName : null; var userPassword = !Model.UseCurrentUser ? Model.UserPassword: null; if (await client.Connect(Model.SharePointWebUrl, userName, userPassword) != null) { Client = client; Model.AddNewUrl(Model.SharePointWebUrl); Model.AddUserToHistory(); Model.Save(); DialogResult = true; } StatusNotification.Notify("Connected"); } catch (Exception ex) { ExceptionHandler.HandleConnection(ex); } Model.IsConnecting = false; }
private void Connected(ISharePointProvider client) { if (client != null) { ucWebs.Add(client); } }
private async void ucConnectButton_Click(object sender, RoutedEventArgs e) { Telemetry.Instance.Native?.TrackEvent("Connect.OK", new Dictionary <string, string> { { "ProviderType", Model.ProviderType.ToString() }, }); var client = SharePointProviderFactory.Create(Model.ProviderType); try { Model.IsConnecting = true; StatusNotification.NotifyWithProgress("Connecting..."); if (await client.Connect(Model.SharePointWebUrl, Model.UserName, Model.UserPassword) != null) { Client = client; Model.AddNewUrl(Model.SharePointWebUrl); Model.AddUserToHistory(Model.UserName); Model.Save(); OnDialogResult(client); } StatusNotification.Notify("Connected"); } catch (Exception ex) { Model.ErrorMessage = "Error: " + ExceptionHandler.HandleConnection(ex); } Model.IsConnecting = false; }
public void Add(ISharePointProvider client) { if (client == null) { return; } Webs.Add(new ListTreeItem { Client = client }); }
private void Connected(ISharePointProvider client) { ucWebs.Add(client); }
public Web(ISharePointProvider client) { Client = client; }
public void Add(ISharePointProvider client) { if (client == null) return; Webs.Add(new ListTreeItem { Client = client} ); }
private void OnDialogResult(ISharePointProvider provider) { this.Visibility = Visibility.Collapsed; DialogResult?.Invoke(this, provider); }