本文整理汇总了C#中Realm.allObjects方法的典型用法代码示例。如果您正苦于以下问题:C# Realm.allObjects方法的具体用法?C# Realm.allObjects怎么用?C# Realm.allObjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Realm
的用法示例。
在下文中一共展示了Realm.allObjects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: onStart
public override void onStart()
{
base.onStart();
// Create Realm instance for the UI thread
realm = Realm.DefaultInstance;
// Create a RealmQuery on the UI thread and send the results to the custom view. The
// RealmResults will automatically be updated whenever the Realm data is changed.
// We still need to invalidate the UI to show the changes however. See the RealmChangeListener.
//
// Note that the query gets updated by rerunning it on the thread it was
// created. This can negatively effect frame rates if it is a complicated query or a very
// large data set.
dotsView.RealmResults = realm.allObjects(typeof(Dot));
}
示例2: realmString
private string realmString(Realm realm)
{
StringBuilder stringBuilder = new StringBuilder();
foreach (Person person in realm.allObjects(typeof(Person)))
{
stringBuilder.Append(person.ToString()).Append("\n");
}
return (stringBuilder.Length == 0) ? "<empty>" : stringBuilder.ToString();
}