Beispiel #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (sender == ButtonCancel)
            {
                DialogResult = false;
            }
            else
            {
                Gist = GistClient.PostGist(Gist);

                Cancelled    = false;
                DialogResult = true;
            }

            Close();
        }
        public void PostJsonTest()
        {
            var addin = new GistIntegration.PasteCodeAsGistAddin();

            var gist = new GistItem
            {
                code        = "int x = 11102;",
                description = "Test addin code",
                filename    = "test.cs",
                isPublic    = true
            };
            var result = GistClient.PostGist(gist, PasteCodeAsGistConfiguration.Current.GithubUserToken);

            Assert.IsNotNull(result, "Gist is null");

            Console.WriteLine(result.htmlUrl);
            Console.WriteLine(result.id);
            Console.Write(result.embedUrl);

            ShellUtils.GoUrl(result.htmlUrl);
        }