本文整理汇总了C#中DataManager.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# DataManager.Delete方法的具体用法?C# DataManager.Delete怎么用?C# DataManager.Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataManager
的用法示例。
在下文中一共展示了DataManager.Delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Die
public void Die(Tile tile, Person person)
{
//ReducePopulation (tile, numberOfPeople);
tile.TotalDeaths += 1;
var data = new DataManager ();
data.Delete (person);
var list = new List<Person> (tile.People);
list.Remove (person);
tile.People = list.ToArray ();
}
示例2: Test_TwoWayReference_RemoveOnDelete
// TODO: Remove or reimplement
//[Test]
public void Test_TwoWayReference_RemoveOnDelete()
{
Console.WriteLine ("");
Console.WriteLine ("Preparing test...");
Console.WriteLine ("");
var data = new DataManager();
data.Settings.IsVerbose = true;
data.WriteSummary ();
var invoiceItem = new ExampleInvoiceItem ();
var invoice = new ExampleInvoice (invoiceItem);
data.Save(invoice, true);
data.WriteSummary ();
Console.WriteLine ("");
Console.WriteLine ("Executing test code...");
Console.WriteLine ("");
data.Delete(invoice);
data.WriteSummary ();
var newInvoice = data.Get<ExampleInvoice> (invoice.Id);
Assert.AreEqual(0, newInvoice.Items.Length, "Linker failed to remove the link.");
}