本文整理汇总了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);
}
示例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>();
}
示例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]);
}
}
示例4: GitFileSystemStatusEntry
public GitFileSystemStatusEntry(String repositoryWorkingDirectory, String filesystemWorkingDirectory, String filePath, FileStatus status)
{
this.repositoryWorkingDirectory = repositoryWorkingDirectory;
this.filesystemWorkingDirectory = filesystemWorkingDirectory;
this.filePath = filePath;
this.status = status;
}
示例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));
}
}
}
示例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());
}
}
示例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());
}
}
示例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>();
}
示例9: TaskResultData
public TaskResultData()
{
sFormat = "";
sKey = "";
eStatus = FileStatus.None;
nStatusInfo = 0;
oLastOpenDate = DateTime.UtcNow;
sTitle = "";
}
示例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()));
}
}
示例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;
}
示例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));
}
示例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() }));
}
}
示例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);
}
}
示例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;
}