本文整理汇总了C#中EntityType.AddField方法的典型用法代码示例。如果您正苦于以下问题:C# EntityType.AddField方法的具体用法?C# EntityType.AddField怎么用?C# EntityType.AddField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EntityType
的用法示例。
在下文中一共展示了EntityType.AddField方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SixBookmarksRuntime
/// <summary>
/// Private constructor.
/// </summary>
private SixBookmarksRuntime()
{
// settings...
this.Settings = SimpleXmlPropertyBag.Load("Settings.xml", false);
// register the entity type...
EntityType bookmark = new EntityType(typeof(Bookmark), "Bookmark");
bookmark.AddField(Bookmark.BookmarkIdKey, Bookmark.BookmarkIdKey, DataType.Int32, -1).IsKey = true;
bookmark.AddField(Bookmark.NameKey, Bookmark.NameKey, DataType.String, 128);
bookmark.AddField(Bookmark.UrlKey, Bookmark.UrlKey, DataType.String, 128);
bookmark.AddField(Bookmark.OrdinalKey, Bookmark.OrdinalKey, DataType.Int32, -1);
bookmark.AddField(Bookmark.IsLocalModifiedKey, Bookmark.IsLocalModifiedKey, DataType.Boolean, -1);
bookmark.AddField(Bookmark.IsLocalDeletedKey, Bookmark.IsLocalDeletedKey, DataType.Boolean, -1);
EntityType.RegisterEntityType(bookmark);
}
示例2: SixBookmarksRuntime
/// <summary>
/// Private constructor.
/// </summary>
private SixBookmarksRuntime()
{
// register the entity type...
EntityType bookmark = new EntityType(typeof(Bookmark), "Bookmark");
bookmark.AddField(Bookmark.BookmarkIdKey, Bookmark.BookmarkIdKey, DataType.Int32, -1).IsKey = true;
bookmark.AddField(Bookmark.NameKey, Bookmark.NameKey, DataType.String, 128).IsOnServer = true;
bookmark.AddField(Bookmark.UrlKey, Bookmark.UrlKey, DataType.String, 128).IsOnServer = true;
bookmark.AddField(Bookmark.OrdinalKey, Bookmark.OrdinalKey, DataType.Int32, -1).IsOnServer = true;
bookmark.AddField(Bookmark.IsLocalModifiedKey, Bookmark.IsLocalModifiedKey, DataType.Boolean, -1);
bookmark.AddField(Bookmark.IsLocalDeletedKey, Bookmark.IsLocalDeletedKey, DataType.Boolean, -1);
EntityType.RegisterEntityType(bookmark);
// ensure...
string appDataPath = this.ApplicationFolderPath;
if (!(Directory.Exists(appDataPath)))
Directory.CreateDirectory(appDataPath);
// settings...
this.Settings = SimpleXmlPropertyBag.Load(Path.Combine(appDataPath, "Settings.xml"), false);
}