Ejemplo n.º 1
0
        private EntityType GetErrandType()
        {
            var entityType = new EntityType("Errand", null);

            entityType.AddField(new EntityTypeFieldItem()
            {
                FieldId          = "Price",
                FieldDescription = "Цена",
                FieldType        = "int"
            });
            return(entityType);
        }
		/// <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);
		}
		/// <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);
        }