protected virtual void InitializeClassificationsList(bool importableOnly) { ArrayList requiredClassificationList = new ArrayList(); // ArrayList excludedClassificationList = null; ArrayList requiredAssetList = null; // If we have no MOG_Property(s), populate as a full TreeView if (MogPropertyList.Count > 0) { // Get the list of required classifications requiredClassificationList = MOG_DBAssetAPI.GetAllActiveClassifications((MOG_Property)MogPropertyList[0]); // // Get the list of excluded classifications for this node classification // excludedClassificationList = MOG_DBAssetAPI.GetAllActiveClassifications((MOG_Property)MogPropertyList[0], true); // Check if we should show asset-level nodes? if (ShowAssets || ExpandPackageGroups) { // Get the list of required assets requiredAssetList = MOG_DBAssetAPI.GetAllAssetsByProperty((MOG_Property)MogPropertyList[0]); } } else { ArrayList childClassifications = MOG_DBAssetAPI.GetClassificationChildren(MOG_ControllerProject.GetProjectName()); if (childClassifications != null) { requiredClassificationList.AddRange(childClassifications); } } // Process our list of required classifications mRequiredClassifications.Clear(); if (requiredClassificationList != null && requiredClassificationList.Count > 0) { foreach (string classificationName in requiredClassificationList) { // Do we already have this class? if (!mRequiredClassifications.Contains(classificationName)) { bool excluded = false; if (ExclusionList.Length > 0) { excluded = StringUtils.IsFiltered(classificationName, ExclusionList); } // Is it excluded? if (excluded == false) { if (!importableOnly || !MOG_Filename.IsLibraryClassification(classificationName)) { //we don't have this classification yet, so add it and give it a container for assets List <string> assetList = new List <string>(); mRequiredClassifications.Add(classificationName, assetList); } } } } } // Process our list of excluded classifications if (false) { // We need to perform a query and get all the classifications that contain a specific exclusion // Then examine each one and add any that are applicable to excluding the file in question to the mExcludedClassifications list // This was not implemented because of timeing and the need to obtain the file in question } // Process our list of required assets if (requiredAssetList != null && requiredAssetList.Count > 0) { foreach (MOG_Filename requiredAsset in requiredAssetList) { if (!importableOnly || !MOG_Filename.IsLibraryClassification(requiredAsset.GetAssetClassification())) { // Check if this asset is excluded? bool excluded = false; if (ExclusionList.Length > 0) { excluded = StringUtils.IsFiltered(requiredAsset.GetAssetFullName(), ExclusionList); } // Make sure we are not excluded? if (!excluded) { mRequiredAssets[requiredAsset.GetAssetFullName()] = requiredAsset; } } } } }
protected override void InitializeClassificationsList(bool importableOnly) { lock (mRequiredClassifications) { ArrayList assets; ArrayList classifications; // If we have no MOG_Property(s), populate as a full TreeView if (MogPropertyList.Count > 0) { assets = MOG_DBAssetAPI.GetAllAssetsByClassificationAndProperties("", MogPropertyList, true); classifications = MOG_DBAssetAPI.GetAllActiveClassifications(MogPropertyList[0] as MOG_Property); } else { assets = MOG_DBAssetAPI.GetAllAssets(); classifications = MOG_DBAssetAPI.GetAllActiveClassifications(); } mRequiredClassifications.Clear(); if (classifications != null && classifications.Count > 0) { foreach (string classificationName in classifications) { // Do we already have this class? if (!mRequiredClassifications.Contains(classificationName)) { bool excluded = false; if (ExclusionList.Length > 0) { excluded = StringUtils.IsFiltered(classificationName, ExclusionList); } // Is it excluded? if (excluded == false) { if (!importableOnly || !MOG_Filename.IsLibraryClassification(classificationName)) { //we don't have this classification yet, so add it and give it a container for assets List <string> assetList = new List <string>(); mRequiredClassifications.Add(classificationName, assetList); } } } } } if (assets != null && assets.Count > 0) { foreach (MOG_Filename asset in assets) { if (!importableOnly || !MOG_Filename.IsLibraryClassification(asset.GetAssetClassification())) { int index = mRequiredClassifications.IndexOfKey(asset.GetAssetClassification()); if (index == -1) { List <string> assetList = new List <string>(); mRequiredClassifications.Add(asset.GetAssetClassification(), assetList); index = mRequiredClassifications.Count - 1; } if (index >= 0) { List <string> assetList = mRequiredClassifications.GetByIndex(index) as List <string>; if (assetList != null) { bool excluded = false; if (ExclusionList.Length > 0) { excluded = StringUtils.IsFiltered(asset.GetAssetFullName(), ExclusionList); } // Is it excluded? if (excluded == false) { assetList.Add(asset.GetAssetFullName()); } } } } } } } }