本文整理匯總了C#中Sharpen.FilePath.CanWrite方法的典型用法代碼示例。如果您正苦於以下問題:C# FilePath.CanWrite方法的具體用法?C# FilePath.CanWrite怎麽用?C# FilePath.CanWrite使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sharpen.FilePath
的用法示例。
在下文中一共展示了FilePath.CanWrite方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Test002_WriteEmptyTree
public virtual void Test002_WriteEmptyTree()
{
// One of our test packs contains the empty tree object. If the pack is
// open when we create it we won't write the object file out as a loose
// object (as it already exists in the pack).
//
Repository newdb = CreateBareRepository();
ObjectInserter oi = newdb.NewObjectInserter();
ObjectId treeId = oi.Insert(new TreeFormatter());
oi.Release();
NUnit.Framework.Assert.AreEqual("4b825dc642cb6eb9a060e54bf8d69288fbee4904", treeId
.Name);
FilePath o = new FilePath(new FilePath(new FilePath(newdb.Directory, "objects"),
"4b"), "825dc642cb6eb9a060e54bf8d69288fbee4904");
NUnit.Framework.Assert.IsTrue(o.IsFile(), "Exists " + o);
NUnit.Framework.Assert.IsTrue(!o.CanWrite(), "Read-only " + o);
}