コード例 #1
0
        internal SqliteCatalogStoreItem(SqliteCatalogStore store, long itemId)
        {
            _store = store;
            _id = itemId;
            _loaded = false;
            _persisting = false;

            _uri = null;
            _title = null;
            _type = null;
            _tags = new StringCollection();
            _parent = null;
            _aliasOf = null;
            _aliases = new SqliteCatalogStoreItemCollection();
            _children = new SqliteCatalogStoreItemCollection();
        }
コード例 #2
0
ファイル: ItemPersistor.cs プロジェクト: anelson/mercury
        /// <summary>Gets all items in the root of the store.</summary>
        /// 
        /// <returns></returns>
        public SqliteCatalogStoreItemCollection GetRootItems()
        {
            SqliteCatalogStoreItemCollection col = new SqliteCatalogStoreItemCollection();

            String sql = @"
                  select catalog_item_id from catalog_items where parent_catalog_item_id is null";
            using (SQLiteCommand cmd = _conn.CreateCommand()) {
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = sql;

                SQLiteDataReader rdr = cmd.ExecuteReader();

                while (rdr.Read()) {
                    col.Add(_store.GetItem(rdr.GetInt64(0)));
                }

                rdr.Close();
            }

            return col;
        }