本文整理汇总了C#中Entry.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Entry.Save方法的具体用法?C# Entry.Save怎么用?C# Entry.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entry
的用法示例。
在下文中一共展示了Entry.Save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveTest
public void SaveTest()
{
Entry target = new Entry();
target.Save(".");
Assert.IsFalse(target.IsDirty);
Assert.IsTrue(File.Exists(target.FileName));
Entry loaded = Entry.LoadFromFile(target.FileName);
Assert.AreEqual(target, loaded);
}
示例2: DeleteTest
public void DeleteTest()
{
Entry target = new Entry();
string folderPath = ".";
target.Save(folderPath);
Assert.IsTrue(File.Exists(target.FileName));
target.Delete(folderPath);
Assert.IsFalse(File.Exists(target.FileName));
}
示例3: NewEntryActivityTest
public void NewEntryActivityTest()
{
Entry target = new Entry();
Assert.AreEqual("Stationary", target.Activity);
string folderPath = ".";
target.Save(folderPath);
Assert.IsTrue(File.Exists(target.FileName));
string contents = File.ReadAllText(target.FileName);
Assert.IsTrue(contents.Contains("<key>Activity</key>"));
Assert.IsTrue(contents.Contains("<string>Stationary</string>"));
Entry loadedEntry = Entry.LoadFromFile(target.FileName);
Assert.AreEqual("Stationary", loadedEntry.Activity);
}
示例4: SaveTest1
public void SaveTest1()
{
Entry target = new Entry();
target.Starred = true;
target.EntryText = "This is the body.\n나는 바디다.";
target.Save(".");
Assert.IsFalse(target.IsDirty);
Assert.IsTrue(File.Exists(target.FileName));
Entry loaded = Entry.LoadFromFile(target.FileName);
Assert.AreEqual(target, loaded);
}