本文整理匯總了C#中ThoughtWorks.CruiseControl.Core.Modification.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# Modification.ToString方法的具體用法?C# Modification.ToString怎麽用?C# Modification.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ThoughtWorks.CruiseControl.Core.Modification
的用法示例。
在下文中一共展示了Modification.ToString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: toModifcations
/// <summary>
/// Convert the passed changeset to an array of modifcations.
/// </summary>
private Modification[] toModifcations(Changeset changeset)
{
List<Modification> modifications = new List<Modification>();
string userName = changeset.Committer;
string comment = changeset.Comment;
int changeNumber = changeset.ChangesetId;
// In VSTS, the version of the file is the same as the changeset number it was checked in with.
string version = Convert.ToString(changeNumber);
DateTime modifedTime = this.TFS.TimeZone.ToLocalTime(changeset.CreationDate);
foreach (Change change in changeset.Changes)
{
Modification modification = new Modification();
modification.UserName = userName;
modification.Comment = comment;
modification.ChangeNumber = changeNumber;
modification.ModifiedTime = modifedTime;
modification.Version = version;
modification.Type = PendingChange.GetLocalizedStringForChangeType(change.ChangeType);
// Populate fields from change item
Item item = change.Item;
if (item.ItemType == ItemType.File)
{
// split into foldername and filename
int lastSlash = item.ServerItem.LastIndexOf('/');
modification.FileName = item.ServerItem.Substring(lastSlash + 1);
// patch to the following line submitted by Ralf Kretzschmar.
modification.FolderName = item.ServerItem.Substring(0, lastSlash);
}
else
{
// TODO - what should filename be if dir?? Empty string or null?
modification.FileName = string.Empty;
modification.FolderName = item.ServerItem;
}
Log.Debug(modification.ToString());
modifications.Add(modification);
}
return modifications.ToArray();
}