Ejemplo n.º 1
0
        private async void webBrowser_Navigating(object sender, NavigatingCancelEventArgs e)
        {
            if (e.Uri.AbsoluteUri.Contains("code="))
            {
                e.Cancel = true;
                webBrowser.Visibility = Visibility.Collapsed;

                var authCode = Regex.Split(e.Uri.AbsoluteUri, "code=")[1];

                //get access token
                await gistClient.Authorize(authCode);
                ISEInterop.Config.ObjectModelRoot = HostObject;
                var gistRepo = new GistRepository(gistClient);
                viewModel = new MainViewModel(gistRepo);
                this.DataContext = viewModel;
                await viewModel.Load();
            }
        }
Ejemplo n.º 2
0
        private async void webBrowser_Navigating(object sender, NavigatingCancelEventArgs e)
        {
            if (e.Uri.AbsoluteUri.Contains("code="))
            {
                e.Cancel = true;
                webBrowser.Visibility = Visibility.Collapsed;

                var authCode = Regex.Split(e.Uri.AbsoluteUri, "code=")[1];

                //get access token
                await gistClient.Authorize(authCode);

                ISEInterop.Config.ObjectModelRoot = HostObject;
                var gistRepo = new GistRepository(gistClient);
                viewModel        = new MainViewModel(gistRepo);
                this.DataContext = viewModel;
                await viewModel.Load();
            }
        }
Ejemplo n.º 3
0
 public MainViewModel(GistRepository repo) : this()
 {
     this.repo   = repo;
     AddFileName = "newFile.ps1";
 }
Ejemplo n.º 4
0
 public MainViewModel(GistRepository repo) : this()
 {
     this.repo = repo;
     AddFileName = "newFile.ps1";
 }