Ejemplo n.º 1
0
        /// <summary>
        /// Generates a list of PipReferences based on the filters from the user
        /// </summary>
        /// <returns>The list of PipReferences that match the filters</returns>
        public List <PipReference> GeneratePipList()
        {
            List <PipReference> toFilter = PipGraph.AsPipReferences(PipTable.StableKeys, PipQueryContext.PipGraphRetrieveAllPips).ToList();

            // For performance, we filter by removing from the list back to front
            for (int i = toFilter.Count - 1; i >= 0; i--)
            {
                // We always filter out Pips with zeroed SSHs since they didn't perform any work
                if (Convert.ToInt64(toFilter[i].SemiStableHash) == 0)
                {
                    toFilter.RemoveAt(i);
                }
                // Filter out Pips that don't match the PipType filter
                else if (Filters.PipTypeFilter != null &&
                         toFilter[i].PipType != Filters.PipTypeFilter.Value)
                {
                    toFilter.RemoveAt(i);
                }
                // Filter out Pips that don't match the SSH filter
                else if (Filters.PipSemiStableHash != 0 &&
                         toFilter[i].SemiStableHash != Filters.PipSemiStableHash)
                {
                    toFilter.RemoveAt(i);
                }
            }

            return(toFilter);
        }