private ArrayList ExcludeAssets(ArrayList assetList, string classification) { // Check if we have any properties associated with this tree? if (MogPropertyList.Count > 0) { // Get the list of excluded assets for this node classification ArrayList excludedAssetList = MOG_DBAssetAPI.GetAllAssetsByProperty(classification, (MOG_Property)MogPropertyList[0], true); foreach (MOG_Filename excludedAsset in excludedAssetList) { // Check if this excludedAsset is listed? foreach (MOG_Filename asset in assetList) { if (string.Compare(asset.GetAssetFullName(), excludedAsset.GetAssetFullName(), true) == 0) { // Remove this asset from the list assetList.Remove(asset); break; } } } } return(assetList); }
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; } } } } }