Пример #1
0
        public GistRepository(GistClient client)
        {
            if (client == null)
            {
                throw new ArgumentException("No client provided");
            }

            this.client = client;
        }
Пример #2
0
        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);
        }
Пример #3
0
        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;
            }
        }
Пример #4
0
 public GistsWindowViewModel(string clientId, string clientSecret)
 {
     this._gistClient = new GistClient(clientId, clientSecret, "WpfGists/0.5");
     this.ListItems = new ObservableCollection<GistListItem>();
     this.ShowPreview = true;
 }