public LoadGistWindow(PasteCodeAsGistAddin addin)
        {
            Addin = addin;

            InitializeComponent();

            mmApp.SetThemeWindowOverride(this);

            Model = new LoadAndSaveGistModel(addin)
            {
                Configuration = PasteCodeAsGistConfiguration.Current,
                GistUsername  = PasteCodeAsGistConfiguration.Current.GithubUsername
            };
            Model.PropertyChanged += (o, args) =>
            {
                if (args.PropertyName == "GistUsername")
                {
                    Task t = Model.LoadGists(this);
                }
            };
            DataContext = Model;

            Loaded += LoadGistWindow_Loaded;

            Status = new StatusBarHelper(StatusText, StatusIcon);
        }
Example #2
0
        public PasteCodeAsGitWindow(GistIntegration.PasteCodeAsGistAddin addin)
        {
            Addin = addin;

            Cancelled = true;

            Gist = new GistItem();

            InitializeComponent();


            mmApp.SetThemeWindowOverride(this);

            Loaded += PasteCode_Loaded;

            WebBrowserCode.Visibility = Visibility.Hidden;
        }
        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);
        }
Example #4
0
 public LoadAndSaveGistModel(PasteCodeAsGistAddin addin)
 {
     Addin = addin;
 }