/// <summary> /// Expand the Children for an ASSET DETAILS based field /// </summary> /// <param name="field"></param> /// <param name="returnDictionary"></param> protected void ExpandApplicationFieldChildren(string field) { // Split the field into its parts again List <string> listParts = Utility.ListFromString(field, '|', true); // If we have not already done so populate the cached list of Applications if (_cachedApplicationsList == null) { _cachedApplicationsList = new ApplicationPublisherList(_publisherFilter, _showIncluded, _showIgnored); } // OK - the string is formatted as Applications | Publisher | Application // Therefore we know if we have 1 part include all applications, 2 parts then this is a Publisher // 3 parts it is an application if (listParts.Count == 1) { // get a list of ALL Publishers and applications first AddApplications(_cachedApplicationsList); } else if (listParts.Count == 2) { string publisher = listParts[1]; ApplicationPublisher thisPublisher = _cachedApplicationsList.FindPublisher(publisher); ApplicationPublisherList listPublishers = new ApplicationPublisherList(); listPublishers.Add(thisPublisher); AddApplications(listPublishers); } else { this.Add(new AuditDataReportColumn(AuditDataReportColumn.eFieldType.applications, field, GetLabelForField(field))); } }
/// <summary> /// Add applications from a list of publishers and applications to our list of displayed fields /// </summary> /// <param name="listPublishers"></param> /// <param name="returnDictionary"></param> protected void AddApplications(ApplicationPublisherList listPublishers) { // Add the publishers to the tree foreach (ApplicationPublisher thePublisher in listPublishers) { // Add the Applications beneath this publisher foreach (InstalledApplication theApplication in thePublisher) { string field = AWMiscStrings.ApplicationsNode + "|" + thePublisher.Name + "|" + theApplication.Name; this.Add(new AuditDataReportColumn(AuditDataReportColumn.eFieldType.applications, field, GetLabelForField(field))); } } }
/// <summary> /// Populate our cached lists /// </summary> public void ResetCache() { _cachedApplicationsList = null; _cachedUserDataList = null; _cacheOperatingSystemList = null; }