Ejemplo n.º 1
0
        /// <summary>
        /// Populate this Asset Group with it's children (both child groups and assets)
        /// Note that this may recurse through its children populating them also
        /// Child assets may be excluded !!!
        /// </summary>
        /// <returns></returns>
        public int Populate(bool recurse, bool ignoreChildAssets, bool applyStates)
        {
            // First get child groups
            AuditWizardDataAccess lwDataAccess = new AuditWizardDataAccess();

            _groups = new AssetGroupList(lwDataAccess.GetGroups(this), _groupType);

            // ...then get child assets
            _assets = new AssetList(lwDataAccess.GetAssets(GroupID, GroupType, applyStates), ignoreChildAssets);

            // If we have been requested to recurse then go through each group
            if (recurse)
            {
                foreach (AssetGroup childGroup in Groups)
                {
                    childGroup.Populate(recurse, ignoreChildAssets, applyStates);
                }
            }

            // Show that we have populated this group
            Populated = true;

            return(0);
        }