当前位置: 首页>>代码示例>>C#>>正文


C# FileStatus类代码示例

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


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


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