本文整理匯總了C#中NGit.Dircache.DirCacheEntry.SetCreationTime方法的典型用法代碼示例。如果您正苦於以下問題:C# DirCacheEntry.SetCreationTime方法的具體用法?C# DirCacheEntry.SetCreationTime怎麽用?C# DirCacheEntry.SetCreationTime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NGit.Dircache.DirCacheEntry
的用法示例。
在下文中一共展示了DirCacheEntry.SetCreationTime方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CopyMetaDataHelper
private void CopyMetaDataHelper(bool keepStage)
{
DirCacheEntry e = new DirCacheEntry("some/path", DirCacheEntry.STAGE_2);
e.IsAssumeValid = false;
e.SetCreationTime(2L);
e.FileMode = FileMode.EXECUTABLE_FILE;
e.LastModified = 3L;
e.SetLength(100L);
e.SetObjectId(ObjectId.FromString("0123456789012345678901234567890123456789"));
e.IsUpdateNeeded = true;
DirCacheEntry f = new DirCacheEntry("someother/path", DirCacheEntry.STAGE_1);
f.IsAssumeValid = true;
f.SetCreationTime(10L);
f.FileMode = FileMode.SYMLINK;
f.LastModified = 20L;
f.SetLength(100000000L);
f.SetObjectId(ObjectId.FromString("1234567890123456789012345678901234567890"));
f.IsUpdateNeeded = true;
e.CopyMetaData(f, keepStage);
NUnit.Framework.Assert.IsTrue(e.IsAssumeValid);
NUnit.Framework.Assert.AreEqual(10L, e.GetCreationTime());
NUnit.Framework.Assert.AreEqual(ObjectId.FromString("1234567890123456789012345678901234567890"
), e.GetObjectId());
NUnit.Framework.Assert.AreEqual(FileMode.SYMLINK, e.FileMode);
NUnit.Framework.Assert.AreEqual(20L, e.LastModified);
NUnit.Framework.Assert.AreEqual(100000000L, e.Length);
if (keepStage)
{
NUnit.Framework.Assert.AreEqual(DirCacheEntry.STAGE_2, e.Stage);
}
else
{
NUnit.Framework.Assert.AreEqual(DirCacheEntry.STAGE_1, e.Stage);
}
NUnit.Framework.Assert.IsTrue(e.IsUpdateNeeded);
NUnit.Framework.Assert.AreEqual("some/path", e.PathString);
}