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();
                }
            }
        }
示例#2
0
 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;
 }
示例#3
0
        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;
        }
示例#4
0
        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();
            }
        }
示例#5
0
 private void LoadTemplateCatalog(string catalogPath)
 {
     _isDefaultLocation = false;
     _dataset = new CatalogDataset();
     _dataset.ReadXml(catalogPath);
 }
 private void LoadTemplateCatalog(string catalogPath)
 {
     _isDefaultLocation = false;
     _dataset           = new CatalogDataset();
     _dataset.ReadXml(catalogPath);
 }
示例#7
0
 public CatalogItemType(CatalogDataset.CatalogItemTypeRow row)
 {
     currentRow = row;
 }
示例#8
0
        public CatalogItem(Catalog cat, CatalogDataset.CatalogItemsRow row)
        {
            currentRow = row;
            _cat = cat;

#if HAVE_COUNTERS_DISPLAY
            _totalChildrenCount = -1;
#endif
        }