• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# FileStatus类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中FileStatus的典型用法代码示例。如果您正苦于以下问题:C# FileStatus类的具体用法?C# FileStatus怎么用?C# FileStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FileStatus类属于命名空间,在下文中一共展示了FileStatus类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetHandler

        // Executes GET requsts for all files
        private static ActionResult GetHandler(IFileHandler handler)
        {
            IFileStatus status = new FileStatus();
            using (FilesModel db = new FilesModel())
            {
                foreach (var row in db.Files)
                {
                    string url = handler.Context.Request.Url.OriginalString + "?fileName=" + row.Id.ToString();

                    IFileStatusItem file = new FileStatusItem()
                    {
                        ContentType = row.Type,
                        DeleteType = "DELETE",
                        FileName = row.Name,
                        FileSize = row.Size,
                        OriginalName = row.Original,
                        Progress = "100",
                        Success = true,
                        ThumbnailUrl = row.Preview,

                        // Set an identifier for GET and DELETE requests
                        DeleteUrl = url,
                        FileUrl = url
                    };

                    status.Files.Add(file);
                }
            }

            handler.FileStatus = status;

            // Create client plugin specific result and return an ActionResult
            IBackloadResult result = handler.Services.Core.CreatePluginResult();
            return ResultCreator.Create((IFileStatusResult)result);
        }
开发者ID:rj-max,项目名称:Backload,代码行数:36,代码来源:CustomDatabaseController.cs


示例2: TreeDirectory

 public TreeDirectory(Repository repository, string relativePath, TreeDirectory parent, FileStatus status, string name)
     : base(repository, relativePath, parent, status, name)
 {
     _directories = new List<TreeDirectory>();
     _files = new List<TreeFile>();
     _commits = new List<TreeCommit>();
 }
开发者ID:Kuzq,项目名称:gitter,代码行数:7,代码来源:TreeDirectory.cs


示例3: CanResolveConflictsByRemovingFromTheIndex

        public void CanResolveConflictsByRemovingFromTheIndex(
            bool removeFromWorkdir, string filename, bool existsBeforeRemove, bool existsAfterRemove, FileStatus lastStatus, int removedIndexEntries)
        {
            var path = CloneMergedTestRepo();
            using (var repo = new Repository(path))
            {
                int count = repo.Index.Count;

                string fullpath = Path.Combine(repo.Info.WorkingDirectory, filename);

                Assert.Equal(existsBeforeRemove, File.Exists(fullpath));
                Assert.NotNull(repo.Index.Conflicts[filename]);
                Assert.Equal(0, repo.Index.Conflicts.ResolvedConflicts.Count());

                repo.Index.Remove(filename, removeFromWorkdir);

                Assert.Null(repo.Index.Conflicts[filename]);
                Assert.Equal(count - removedIndexEntries, repo.Index.Count);
                Assert.Equal(existsAfterRemove, File.Exists(fullpath));
                Assert.Equal(lastStatus, repo.Index.RetrieveStatus(filename));

                Assert.Equal(1, repo.Index.Conflicts.ResolvedConflicts.Count());
                Assert.NotNull(repo.Index.Conflicts.ResolvedConflicts[filename]);
            }
        }
开发者ID:AndersKroghDk,项目名称:libgit2sharp,代码行数:25,代码来源:ConflictFixture.cs


示例4: GitFileSystemStatusEntry

 public GitFileSystemStatusEntry(String repositoryWorkingDirectory, String filesystemWorkingDirectory, String filePath, FileStatus status)
 {
     this.repositoryWorkingDirectory = repositoryWorkingDirectory;
     this.filesystemWorkingDirectory = filesystemWorkingDirectory;
     this.filePath = filePath;
     this.status = status;
 }
开发者ID:jrbriggs,项目名称:gitpowershell,代码行数:7,代码来源:GitFileSystemStatusEntry.cs


示例5: CanRemoveAnUnalteredFileFromTheIndexWithoutRemovingItFromTheWorkingDirectory

        public void CanRemoveAnUnalteredFileFromTheIndexWithoutRemovingItFromTheWorkingDirectory(
            bool removeFromWorkdir, string filename, bool throws, FileStatus initialStatus, bool existsBeforeRemove, bool existsAfterRemove, FileStatus lastStatus)
        {
            string path = SandboxStandardTestRepo();
            using (var repo = new Repository(path))
            {
                int count = repo.Index.Count;

                string fullpath = Path.Combine(repo.Info.WorkingDirectory, filename);

                Assert.Equal(initialStatus, repo.RetrieveStatus(filename));
                Assert.Equal(existsBeforeRemove, File.Exists(fullpath));

                if (throws)
                {
                    Assert.Throws<RemoveFromIndexException>(() => repo.Remove(filename, removeFromWorkdir));
                    Assert.Equal(count, repo.Index.Count);
                }
                else
                {
                    repo.Remove(filename, removeFromWorkdir);

                    Assert.Equal(count - 1, repo.Index.Count);
                    Assert.Equal(existsAfterRemove, File.Exists(fullpath));
                    Assert.Equal(lastStatus, repo.RetrieveStatus(filename));
                }
            }
        }
开发者ID:beulah444,项目名称:libgit2sharp,代码行数:28,代码来源:RemoveFixture.cs


示例6: SetFileStatus

 public void SetFileStatus(FileStatus status)
 {
   switch (status)
   {
     case FileStatus.Waiting:
       this.h9kFNwRSkp(RNaihRhYEl0wUmAftnB.aYu7exFQKN(12286), 0);
       break;
     case FileStatus.Importing:
       this.h9kFNwRSkp(RNaihRhYEl0wUmAftnB.aYu7exFQKN(12304), 1);
       break;
     case FileStatus.Testing:
       this.h9kFNwRSkp(RNaihRhYEl0wUmAftnB.aYu7exFQKN(12326), 4);
       break;
     case FileStatus.DoneOk:
       this.h9kFNwRSkp(RNaihRhYEl0wUmAftnB.aYu7exFQKN(12344), 2);
       break;
     case FileStatus.DoneError:
       this.h9kFNwRSkp(RNaihRhYEl0wUmAftnB.aYu7exFQKN(12356), 3);
       break;
     case FileStatus.Aborted:
       this.h9kFNwRSkp(RNaihRhYEl0wUmAftnB.aYu7exFQKN(12392), 5);
       break;
     default:
       throw new NotSupportedException(RNaihRhYEl0wUmAftnB.aYu7exFQKN(12410) + ((object) status).ToString());
   }
 }
开发者ID:heber,项目名称:FreeOQ,代码行数:26,代码来源:FileViewItem.cs


示例7: SetFileStatus

		public void SetFileStatus(FileStatus status)
		{
			switch (status)
			{
				case FileStatus.Waiting:
					this.SetStatus("Waiting", 0);
					break;
				case FileStatus.Importing:
					this.SetStatus("Importing", 1);
					break;
				case FileStatus.Testing:
					this.SetStatus("Testing", 4);
					break;
				case FileStatus.DoneOk:
					this.SetStatus("Done", 2);
					break;
				case FileStatus.DoneError:
					this.SetStatus("Done with errors", 3);
					break;
				case FileStatus.Aborted:
					this.SetStatus("Aborted", 5);
					break;
				default:
					throw new NotSupportedException("Unknown status - " + status.ToString());
			}
		}
开发者ID:smther,项目名称:FreeOQ,代码行数:26,代码来源:FileViewItem.cs


示例8: TreeDirectoryData

 public TreeDirectoryData(string name, string shortName, TreeDirectoryData parent, FileStatus fileStatus, StagedStatus stagedStatus)
     : base(name, fileStatus, stagedStatus)
 {
     _parent = parent;
     ShortName = shortName;
     _files = new List<TreeFileData>();
     _directories = new List<TreeDirectoryData>();
 }
开发者ID:Kuzq,项目名称:gitter,代码行数:8,代码来源:TreeDirectoryData.cs


示例9: TaskResultData

 public TaskResultData()
 {
     sFormat = "";
     sKey = "";
     eStatus = FileStatus.None;
     nStatusInfo = 0;
     oLastOpenDate = DateTime.UtcNow;
     sTitle = "";
 }
开发者ID:jaime-lee,项目名称:DocumentServer,代码行数:9,代码来源:TaskResult.cs


示例10: ComparingTheWorkDirAgainstTheIndexWithStrictUnmatchedExplicitPathsValidationAndANonExistentPathspecThrows

        public void ComparingTheWorkDirAgainstTheIndexWithStrictUnmatchedExplicitPathsValidationAndANonExistentPathspecThrows(string relativePath, FileStatus currentStatus)
        {
            using (var repo = new Repository(StandardTestRepoPath))
            {
                Assert.Equal(currentStatus, repo.Index.RetrieveStatus(relativePath));

                Assert.Throws<UnmatchedPathException>(() => repo.Diff.Compare<TreeChanges>(new[] { relativePath }, false, new ExplicitPathsOptions()));
            }
        }
开发者ID:AndersKroghDk,项目名称:libgit2sharp,代码行数:9,代码来源:DiffWorkdirToIndexFixture.cs


示例11: FileEventArgs

 public FileEventArgs(FileInfo file, FileStatus status, int objectCount)
 {
   eX4XcIhHpDXt70u2x3N.k8isAcYzkUOGF();
   // ISSUE: explicit constructor call
   base.\u002Ector();
   this.ATYdgQ6h0H = file;
   this.Q7OdM6TVN3 = status;
   this.awIdJYrTF0 = objectCount;
 }
开发者ID:heber,项目名称:FreeOQ,代码行数:9,代码来源:FileEventArgs.cs


示例12: ParsingIndividualLines_WorksCorrectly

        public void ParsingIndividualLines_WorksCorrectly(string statusLine, string[] parsedFiles, FileStatus[] parsedStatuses)
        {
            var app = new ApplicationDefinition(null, string.Empty);
            var command = new Commands.Status();

            var status = command.ProcessResult(app, new Tuple<int, string>(0, statusLine));

            var expected = parsedFiles.Zip(parsedStatuses, (name, fileStatus) => new Status(name, fileStatus)).ToArray();
            Assert.That(status.ToArray(), Is.EquivalentTo(expected));
        }
开发者ID:resnikb,项目名称:GitWorkflows,代码行数:10,代码来源:StatusTests.cs


示例13: StagingAnUnknownFileThrowsIfExplicitPath

        public void StagingAnUnknownFileThrowsIfExplicitPath(string relativePath, FileStatus status)
        {
            using (var repo = new Repository(StandardTestRepoPath))
            {
                Assert.Null(repo.Index[relativePath]);
                Assert.Equal(status, repo.Index.RetrieveStatus(relativePath));

                Assert.Throws<UnmatchedPathException>(() => repo.Index.Stage(relativePath, new StageOptions { ExplicitPathsOptions = new ExplicitPathsOptions() }));
            }
        }
开发者ID:AndersKroghDk,项目名称:libgit2sharp,代码行数:10,代码来源:StageFixture.cs


示例14: Add

 /// <summary>
 ///     Add and stage specified file.
 /// </summary>
 /// <param name="fileName">Name of the file to be added to Lib2GitSharp, then staged ready for commit.</param>
 public void Add(string fileName, FileStatus status)
 {
     using (var repo = new Repository(_LocalRepo))
     {
         if (status != FileStatus.Removed && status != FileStatus.Missing)
         {
             repo.Index.Add(fileName);
         }
         repo.Stage(fileName);
     }
 }
开发者ID:ryanrousseau,项目名称:chuck,代码行数:15,代码来源:Github.cs


示例15: MyFile

 public MyFile(string Name, string Path, long Size, FileStatus status, DateTime LastWriteTime, bool IsDirectory, int FileId, int ParentDirectoryId)
 {
     this.Name = Name;
     this.Path = Path;
     this.Size = Size;
     this.status = status;
     this.LastWriteTime = LastWriteTime;
     this.IsDirectory = IsDirectory;
     this.FileId = FileId;
     this.ParentDirectoryId = ParentDirectoryId;
 }
开发者ID:tel8618217223380,项目名称:sinchosaur,代码行数:11,代码来源:MyFile.struct.cs


示例16: CanLimitStatusToWorkDirOnly

        public void CanLimitStatusToWorkDirOnly(StatusShowOption show, FileStatus expected)
        {
            var clone = SandboxStandardTestRepo();

            using (var repo = new Repository(clone))
            {
                Touch(repo.Info.WorkingDirectory, "file.txt", "content");

                RepositoryStatus status = repo.RetrieveStatus(new StatusOptions() { Show = show });
                Assert.Equal(expected, status["file.txt"].State);
            }
        }
开发者ID:beulah444,项目名称:libgit2sharp,代码行数:12,代码来源:StatusFixture.cs


示例17: TreeItem

 protected TreeItem(Repository repository, string relativePath,
     TreeDirectory parent, FileStatus status, string name)
     : base(repository, name)
 {
     _parent = parent;
     if(parent != null)
     {
         _stagedStatus = parent._stagedStatus;
     }
     _status = status;
     _relativePath = relativePath;
 }
开发者ID:Kuzq,项目名称:gitter,代码行数:12,代码来源:TreeItem.cs


示例18: CanCompareTheWorkDirAgainstTheIndexWithLaxUnmatchedExplicitPathsValidation

        public void CanCompareTheWorkDirAgainstTheIndexWithLaxUnmatchedExplicitPathsValidation(string relativePath, FileStatus currentStatus)
        {
            using (var repo = new Repository(StandardTestRepoPath))
            {
                Assert.Equal(currentStatus, repo.Index.RetrieveStatus(relativePath));

                var changes = repo.Diff.Compare<TreeChanges>(new[] { relativePath }, false, new ExplicitPathsOptions { ShouldFailOnUnmatchedPath = false });
                Assert.Equal(0, changes.Count());

                changes = repo.Diff.Compare<TreeChanges>(new[] { relativePath });
                Assert.Equal(0, changes.Count());
            }
        }
开发者ID:dahlbyk,项目名称:libgit2sharp,代码行数:13,代码来源:DiffWorkdirToIndexFixture.cs


示例19: CanStageAnUnknownFileWithLaxUnmatchedExplicitPathsValidation

        public void CanStageAnUnknownFileWithLaxUnmatchedExplicitPathsValidation(string relativePath, FileStatus status)
        {
            using (var repo = new Repository(StandardTestRepoPath))
            {
                Assert.Null(repo.Index[relativePath]);
                Assert.Equal(status, repo.Index.RetrieveStatus(relativePath));

                Assert.DoesNotThrow(() => repo.Index.Stage(relativePath));
                Assert.DoesNotThrow(() => repo.Index.Stage(relativePath, new StageOptions { ExplicitPathsOptions = new ExplicitPathsOptions { ShouldFailOnUnmatchedPath = false } }));

                Assert.Equal(status, repo.Index.RetrieveStatus(relativePath));
            }
        }
开发者ID:AndersKroghDk,项目名称:libgit2sharp,代码行数:13,代码来源:StageFixture.cs


示例20: CanMoveAnExistingFileOverANonExistingFile

        public void CanMoveAnExistingFileOverANonExistingFile(string sourcePath, FileStatus sourceStatus, string destPath, FileStatus destStatus, FileStatus sourcePostStatus, FileStatus destPostStatus)
        {
            string path = CloneStandardTestRepo();
            using (var repo = new Repository(path))
            {
                Assert.Equal(sourceStatus, repo.Index.RetrieveStatus(sourcePath));
                Assert.Equal(destStatus, repo.Index.RetrieveStatus(destPath));

                repo.Index.Move(sourcePath, destPath);

                Assert.Equal(sourcePostStatus, repo.Index.RetrieveStatus(sourcePath));
                Assert.Equal(destPostStatus, repo.Index.RetrieveStatus(destPath));
            }
        }
开发者ID:JenekX,项目名称:libgit2sharp,代码行数:14,代码来源:IndexFixture.cs



注:本文中的FileStatus类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FileStatusList类代码示例发布时间:2022-05-24
下一篇:
C# FileShare类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap