public GistRepository(GistClient client) { if (client == null) { throw new ArgumentException("No client provided"); } this.client = client; }
public PowerGistPanel() { InitializeComponent(); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; GitApiConfig.AlertIfConfigRequired(); gistClient = new GistClient(GitApiConfig.ClientId, GitApiConfig.ClientSecret, "powershellISEAddin"); viewModel = new MainViewModel(); viewModel.Loading = Visibility.Collapsed; //navigate to "https://github.com/login/oauth/authorize" webBrowser.Visibility = Visibility.Visible; webBrowser.Navigate(gistClient.AuthorizeUrl); }
private async void ListGists(GistClient.ListMode mode) { switch (mode) { case GistClient.ListMode.PublicGists: await this.ListPublicGists(); break; case GistClient.ListMode.UsersGists: await this.ListUsersGists(this.UserName); break; case GistClient.ListMode.AuthenticatedUserGists: await this.ListMyGists(); break; case GistClient.ListMode.AuthenticatedUserStarredGists: await this.ListStarredGists(); break; } }
public GistsWindowViewModel(string clientId, string clientSecret) { this._gistClient = new GistClient(clientId, clientSecret, "WpfGists/0.5"); this.ListItems = new ObservableCollection<GistListItem>(); this.ShowPreview = true; }