本文整理汇总了C#中Area.GetRecords方法的典型用法代码示例。如果您正苦于以下问题:C# Area.GetRecords方法的具体用法?C# Area.GetRecords怎么用?C# Area.GetRecords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Area
的用法示例。
在下文中一共展示了Area.GetRecords方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunInternal
protected override bool RunInternal(Area ws, Versionr.Status status, IList<Versionr.Status.StatusEntry> targets, FileBaseCommandVerbOptions options)
{
DiffVerbOptions localOptions = options as DiffVerbOptions;
Objects.Version version = null;
Objects.Version parent = null;
if (!string.IsNullOrEmpty(localOptions.Version))
{
version = Workspace.GetPartialVersion(localOptions.Version);
if (version == null)
{
Printer.PrintError("No version found matching {0}", localOptions.Version);
return false;
}
if (version.Parent.HasValue)
parent = Workspace.GetVersion(version.Parent.Value);
if (parent == null)
{
Printer.PrintMessage("Version {0} has no parent", version.ID);
return true;
}
Printer.PrintMessage("Showing changes for version #c#{0}", version.ID);
}
bool showUnchangedObjects = localOptions.Objects.Count != 0;
List<Task> tasks = new List<Task>();
List<string> tempFiles = new List<string>();
List<System.Diagnostics.Process> diffProcesses = new List<System.Diagnostics.Process>();
try
{
if (version == null)
{
foreach (var x in targets)
{
if (x.VersionControlRecord != null && !x.IsDirectory && x.FilesystemEntry != null && x.Code == StatusCode.Modified)
{
if (Utilities.FileClassifier.Classify(x.FilesystemEntry.Info) == Utilities.FileEncoding.Binary)
{
Printer.PrintMessage("File: #b#{0}## is binary #w#different##.", x.CanonicalName);
continue;
}
// Displaying local modifications
string tmp = Utilities.DiffTool.GetTempFilename();
if (Workspace.ExportRecord(x.CanonicalName, Workspace.Version, tmp))
{
Printer.PrintMessage("Displaying changes for file: #b#{0}", x.CanonicalName);
if (localOptions.External)
{
tempFiles.Add(tmp);
bool nonblocking = Workspace.Directives.NonBlockingDiff.HasValue && Workspace.Directives.NonBlockingDiff.Value;
var t = Utilities.LimitedTaskDispatcher.Factory.StartNew(() =>
{
var diffResult = Utilities.DiffTool.Diff(tmp, x.Name + "-base", Workspace.GetLocalCanonicalName(x.VersionControlRecord), x.Name, ws.Directives.ExternalDiff, nonblocking);
if (diffResult != null)
{
lock (diffProcesses)
{
diffProcesses.Add(diffResult);
}
}
});
if (nonblocking)
tasks.Add(t);
else
t.Wait();
}
else
{
try
{
RunInternalDiff(tmp, System.IO.Path.Combine(Workspace.RootDirectory.FullName, Workspace.GetLocalCanonicalName(x.VersionControlRecord)));
}
finally
{
System.IO.File.Delete(tmp);
}
}
}
}
else if (x.Code == StatusCode.Unchanged && showUnchangedObjects && !x.IsDirectory)
{
var filter = Filter(new KeyValuePair<string, Objects.Record>[] { new KeyValuePair<string, Objects.Record>(x.CanonicalName, x.VersionControlRecord) }).FirstOrDefault();
if (filter.Value != null && filter.Key == true) // check if the file was really specified
Printer.PrintMessage("Object: #b#{0}## is #s#unchanged##.", x.CanonicalName);
}
else if (x.VersionControlRecord == null && showUnchangedObjects)
{
var filter = Filter(new KeyValuePair<string, bool>[] { new KeyValuePair<string, bool>(x.CanonicalName, true) }).FirstOrDefault();
if (filter.Value != false && filter.Key == true) // check if the file was really specified
Printer.PrintMessage("Object: #b#{0}## is #c#unversioned##.", x.CanonicalName);
}
}
}
else
{
if (localOptions.Local)
{
var records = ws.GetRecords(version);
//.........这里部分代码省略.........