private void LoadCompressedCatalog(string catalogPath) { _isDefaultLocation = false; FileStream inputStream = null; GZipStream zipStream = null; try { inputStream = new FileStream(catalogPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); zipStream = new GZipStream(inputStream, CompressionMode.Decompress); _dataset = new CatalogDataset(); _dataset.ReadXml(zipStream); MigrateDataToLatestVersion(); } finally { if (zipStream != null) { zipStream.Close(); } if (inputStream != null) { inputStream.Close(); } } }
private CatalogItem[] GetItemArray(CatalogDataset.CatalogItemsRow[] rows) { CatalogItem[] instances = new CatalogItem[rows.Length]; for (int i = 0; i < rows.Length; i++) { instances[i] = new CatalogItem(this, rows[i]); } return instances; }
private bool CheckRowAncestorship(CatalogDataset.CatalogItemsRow row) { if (row != null) { if (row.IsRoot) return true; CatalogDataset.CatalogItemsRow parentRow = this.CatalogItems.FindByItemID(row.ParentItemID); if (parentRow != null) return CheckRowAncestorship(parentRow); } return false; }
private void LoadCompressedCatalog(string catalogPath) { _isDefaultLocation = false; FileStream inputStream = null; GZipStream zipStream = null; try { inputStream = new FileStream(catalogPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); zipStream = new GZipStream(inputStream, CompressionMode.Decompress); _dataset = new CatalogDataset(); _dataset.ReadXml(zipStream); MigrateDataToLatestVersion(); } finally { if (zipStream != null) zipStream.Close(); if (inputStream != null) inputStream.Close(); } }
private void LoadTemplateCatalog(string catalogPath) { _isDefaultLocation = false; _dataset = new CatalogDataset(); _dataset.ReadXml(catalogPath); }
public CatalogItemType(CatalogDataset.CatalogItemTypeRow row) { currentRow = row; }
public CatalogItem(Catalog cat, CatalogDataset.CatalogItemsRow row) { currentRow = row; _cat = cat; #if HAVE_COUNTERS_DISPLAY _totalChildrenCount = -1; #endif }