Пример #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);
        }
Пример #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);
        }
Пример #3
0
 public GistVirtualDirectory(GistVirtualFiles pathProvider, string dirPath, GistVirtualDirectory parentDir)
     : base(pathProvider, parentDir)
 {
     this.PathProvider = pathProvider;
     this.DirPath      = dirPath;
 }
Пример #4
0
 public GistVirtualFile(GistVirtualFiles pathProvider, IVirtualDirectory directory)
     : base(pathProvider, directory)
 {
     this.PathProvider = pathProvider;
 }