Exemplo n.º 1
0
        public List <string> GetAssets(TreeNode node)
        {
            ArrayList assetList          = new ArrayList();
            string    nodeClassification = node.FullPath;

            // Check if we should show asset-level nodes?
            if (ShowAssets || ExpandPackageGroups)
            {
                // Check if this is a classification we want to display everything in?
                if (ShowEntireClassificationContents(nodeClassification))
                {
                    // Get the list of assets
                    assetList = MOG_DBAssetAPI.GetAllAssetsByClassification(nodeClassification);
                }
                else
                {
                    assetList = GetRequiredAssets(nodeClassification);
                }
            }

            // Exclude assets from our list that have undefined the property
            assetList = ExcludeAssets(assetList, nodeClassification);

            // Prepare our list of assets for return
            List <string> returnAssets = new List <string>();

            foreach (MOG_Filename asset in assetList)
            {
                // Check if we want to exclude platform-specific asset?
                if (!ShowPlatformSpecific)
                {
                    MOG_Filename filename = new MOG_Filename(asset);
                    if (filename.IsPlatformSpecific())
                    {
                        continue;
                    }
                }

                returnAssets.Add(asset.GetAssetFullName());
            }

            return(returnAssets);
        }
Exemplo n.º 2
0
        // recursively check baseClass to see if it or any of its child classes contain assets
        private bool ClassTreeContainsAssets(string baseClass)
        {
            if (MOG_DBAssetAPI.GetAllAssetsByClassification(baseClass).Count > 0)
            {
                return(true);
            }

            // recurse by looking up child classes
            MOG_Project proj = MOG_ControllerProject.GetProject();

            if (proj != null)
            {
                foreach (string className in proj.GetSubClassificationNames(baseClass))
                {
                    if (ClassTreeContainsAssets(baseClass + "~" + className))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }