Exemple #1
0
        public override void Refresh()
        {
            var gist = PathProvider.GetGist(refresh: true);

            if (gist != null)
            {
                if (!GistVirtualFiles.GetGistContents(FilePath, gist, out var text, out var stream))
                {
                    throw new FileNotFoundException("Gist File no longer exists", FilePath);
                }

                Init(FilePath, gist.Updated_At ?? gist.Created_at, text, stream);
                return;
            }

            throw new FileNotFoundException("Gist no longer exists", GistId);
        }
Exemple #2
0
        public override void Refresh()
        {
            var elapsed       = DateTime.UtcNow - PathProvider.LastRefresh;
            var shouldRefresh = elapsed > PathProvider.RefreshAfter;
            var gist          = PathProvider.GetGist(refresh: shouldRefresh);

            if (gist != null)
            {
                if (!GistVirtualFiles.GetGistContents(FilePath, gist, out var text, out var stream))
                {
                    throw new FileNotFoundException("Gist File no longer exists", FilePath);
                }

                Init(FilePath, gist.Updated_At ?? gist.Created_at, text, stream);
                return;
            }

            throw new FileNotFoundException("Gist no longer exists", GistId);
        }