private void InitializeQueries() { seqQuery = from n in names where n.Name.Equals(queryInfo.Name, StringComparison.InvariantCultureIgnoreCase) && n.State == queryInfo.State && n.Year >= yearStart && n.Year <= yearEnd orderby n.Year ascending select n; parQuery = from n in names.AsParallel().WithDegreeOfParallelism(ProcessorsToUse.Value) where n.Name.Equals(queryInfo.Name, StringComparison.InvariantCultureIgnoreCase) && n.State == queryInfo.State && n.Year >= yearStart && n.Year <= yearEnd orderby n.Year ascending select n; }
public int Each(int count, System.Linq.ParallelQuery info) { if (TypeChoose.SelectedValue.ToString() == "textBox") { foreach (var item in info) { TextOut.Text += Frame((string)item) + "\n" + item + "\n"; //Console.WriteLine(Frame((string)item)); //Console.WriteLine(item); count++; } } if (TypeChoose.SelectedValue.ToString() == "listBox") { foreach (var item in info) { ListOut.Items.Add( Frame((string)item) + "\n" + item + "\n" ); //Console.WriteLine(Frame((string)item)); //Console.WriteLine(item); count++; } } return(count); }
void IsEmptyRecur(string path, ParallelQuery<string> files) { string pathToTest = path.EndsWith(@"\") ? path : path + @"\"; if (files.Any(f => f.IndexOf(pathToTest.ToLower()) >= 0)) { var dirs = Directory.EnumerateDirectories(path); foreach (var dir in dirs) { IsEmptyRecur(dir, files); } } else { // empty lbFolders.Items.Add(path); } }
private static List<tagLibrary.Objects.FileTags> ConvertLocalTypesToFileTags(ParallelQuery<tagLibrary.Objects.FileInformationLocalTypes> data) { var tagInfo = data .AsParallel() .Select(m => new tagLibrary.Objects.FileTags( m.FileName, m.TagInfo.Genres.ToList(), m.TagInfo.Album, m.Name, m.Properties.AudioBitrate, m.Properties.Duration, m.TagInfo.AlbumArtists.ToList(), m.TagInfo.Track, m.TagInfo.Year ) ) .ToList(); return tagInfo; }
public Hero GetAllyHero(ParallelQuery<Hero> allies) { switch (Type) { case GetHeroType.ModifierSource: return allies.FirstOrDefault(x => x.Equals(Source)); case GetHeroType.LowestHealthPct: return allies.Where(x => x.HasModifier(Modifier.Name)) .OrderByDescending(x => x.Equals(Hero)) .ThenBy(x => x.Health / x.MaximumHealth) .FirstOrDefault(); case GetHeroType.LowestHealth: return allies.Where(x => x.HasModifier(Modifier.Name)) .OrderByDescending(x => x.Equals(Hero)) .ThenBy(x => x.Health) .FirstOrDefault(); case GetHeroType.ClosestToSource: return allies.Where(x => x.Distance2D(Source) <= MaximumDistanceToSource) .OrderBy(x => x.Distance2D(Source)) .FirstOrDefault(); } return null; }
public static void Intersect_SourceMultiple(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { int seen = 0; Assert.All(leftQuery.Intersect(rightQuery), x => Assert.Equal(seen++, x)); Assert.Equal(count, seen); }
public static ParallelQuery <TResult> Select <TSource, TResult>(this ParallelQuery <TSource> source, Func <TSource, TResult> selector) { throw new NotImplementedException(); }
public static TSource LastOrDefault <TSource>(this ParallelQuery <TSource> source, Func <TSource, bool> predicate) { throw new NotImplementedException(); }
public static Dictionary <TKey, TElement> ToDictionary <TSource, TKey, TElement>(this ParallelQuery <TSource> source, Func <TSource, TKey> keySelector, Func <TSource, TElement> elementSelector) { throw new NotImplementedException(); }
public static ILookup <TKey, TElement> ToLookup <TSource, TKey, TElement>(this ParallelQuery <TSource> source, Func <TSource, TKey> keySelector, Func <TSource, TElement> elementSelector, IEqualityComparer <TKey> comparer) { throw new NotImplementedException(); }
public static bool Contains <TSource>(this ParallelQuery <TSource> source, TSource value, IEqualityComparer <TSource> comparer) { throw new NotImplementedException(); }
public static double Average(this ParallelQuery <double> source) { throw new NotImplementedException(); }
public static Nullable <decimal> Average <TSource>(this ParallelQuery <TSource> source, Func <TSource, Nullable <decimal> > selector) { throw new NotImplementedException(); }
public static bool Contains <TSource>(this ParallelQuery <TSource> source, TSource value) { throw new NotImplementedException(); }
public static double Average <TSource>(this ParallelQuery <TSource> source, Func <TSource, double> selector) { throw new NotImplementedException(); }
public static Nullable <decimal> Average(this ParallelQuery <Nullable <decimal> > source) { throw new NotImplementedException(); }
public static decimal Average(this ParallelQuery <decimal> source) { throw new NotImplementedException(); }
public static void Union_SourceMultiple(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { int seen = 0; Assert.All(leftQuery.AsOrdered().Union(rightQuery.AsOrdered()), x => Assert.Equal(seen++, x)); Assert.Equal(count, seen); }
public static ParallelQuery <TSource> Skip <TSource>(this ParallelQuery <TSource> source, int count) { throw new NotImplementedException(); }
public static void Union_SecondOrdered_SourceMultiple_Longrunning(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { Union_SecondOrdered_SourceMultiple(leftQuery, leftCount, rightQuery, rightCount, count); }
public static bool SequenceEqual <TSource>(this ParallelQuery <TSource> first, IEnumerable <TSource> second) { throw new NotImplementedException(); }
public static Nullable <double> Max <TSource>(this ParallelQuery <TSource> source, Func <TSource, Nullable <double> > selector) { throw new NotImplementedException(); }
public static bool SequenceEqual <TSource>(this ParallelQuery <TSource> first, ParallelQuery <TSource> second, IEqualityComparer <TSource> comparer) { throw new NotImplementedException(); }
public static ILookup <TKey, TSource> ToLookup <TSource, TKey>(this ParallelQuery <TSource> source, Func <TSource, TKey> keySelector) { throw new NotImplementedException(); }
public static void ForAll <TSource>(this ParallelQuery <TSource> source, Action <TSource> action) { throw new NotImplementedException(); }
public static ParallelQuery <TResult> Cast <TResult>(this ParallelQuery source) { throw new NotImplementedException(); }
public static ParallelQuery <TSource> Distinct <TSource>(this ParallelQuery <TSource> source, IEqualityComparer <TSource> comparer) { throw new NotImplementedException(); }
public static TSource Last <TSource>(this ParallelQuery <TSource> source) { throw new NotImplementedException(); }
public static ParallelQuery <TSource> Intersect <TSource>(this ParallelQuery <TSource> first, ParallelQuery <TSource> second) { throw new NotImplementedException(); }
public static ParallelQuery <TSource> WithMergeOptions <TSource>(this ParallelQuery <TSource> source, ParallelMergeOptions mergeOptions) { throw new NotImplementedException(); }
public static ParallelQuery <TSource> Except <TSource>(this ParallelQuery <TSource> first, IEnumerable <TSource> second) { throw new NotImplementedException(); }
private bool DotModifiers(ParallelQuery<Unit> nearEnemies) { var heroModifiers = Hero.HasModifiers(cantToggleArmletHeroModifiers, false); var enemyModifiers = nearEnemies.Any(x => x.HasModifiers(cantToggleArmletEnemyModifiers, false)); return enemyModifiers || heroModifiers; }
public static void Except_SourceMultiple(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int start, int count) { int seen = start; Assert.All(leftQuery.Except(rightQuery), x => Assert.Equal(seen++, x)); Assert.Equal(start + count, seen); }
public static void Intersect_SourceMultiple_Longrunning(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { Intersect_SourceMultiple(leftQuery, leftCount, rightQuery, rightCount, count); }
public static decimal Max <TSource>(this ParallelQuery <TSource> source, Func <TSource, decimal> selector) { throw new NotImplementedException(); }
public static void Union_SecondOrdered_SourceMultiple(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int count) { IntegerRangeSet seenUnordered = new IntegerRangeSet(0, leftCount); int seen = leftCount; foreach (int i in leftQuery.Union(rightQuery.AsOrdered())) { if (i >= leftCount) { Assert.Equal(seen++, i); } else { seenUnordered.Add(i); } } Assert.Equal(count, seen); seenUnordered.AssertComplete(); }
public static void Distinct_SourceMultiple(ParallelQuery<int> query, int count) { int seen = 0; Assert.All(query.Distinct(), x => Assert.Equal(seen++, x)); Assert.Equal(count, seen); }
public static ParallelQuery <TSource> Except <TSource>(this ParallelQuery <TSource> first, IEnumerable <TSource> second, IEqualityComparer <TSource> comparer) { throw new NotImplementedException(); }
public static float Average(this ParallelQuery <float> source) { throw new NotImplementedException(); }
public static void Except_SourceMultiple_Longrunning(ParallelQuery<int> leftQuery, int leftCount, ParallelQuery<int> rightQuery, int rightCount, int start, int count) { Except_SourceMultiple(leftQuery, leftCount, rightQuery, rightCount, start, count); }
public static IEnumerable <TSource> AsEnumerable <TSource>(this ParallelQuery <TSource> source) { throw new NotImplementedException(); }
public static void Distinct_Unordered_SourceMultiple(ParallelQuery<int> query, int count) { // The difference between this test and the previous, is that it's not possible to // get non-unique results from ParallelEnumerable.Range()... // Those tests either need modification of source (via .Select(x => x / DuplicateFactor) or similar, // or via a comparator that considers some elements equal. IntegerRangeSet seen = new IntegerRangeSet(0, count); Assert.All(query.AsUnordered().Distinct(), x => seen.Add(x)); seen.AssertComplete(); }
public static ParallelQuery <TSource> Where <TSource>(this ParallelQuery <TSource> source, Func <TSource, int, bool> predicate) { throw new NotImplementedException(); }
public static void Distinct_SourceMultiple_Longrunning(ParallelQuery<int> query, int count) { Distinct_SourceMultiple(query, count); }
public static Dictionary <TKey, TSource> ToDictionary <TSource, TKey>(this ParallelQuery <TSource> source, Func <TSource, TKey> keySelector, IEqualityComparer <TKey> comparer) { throw new NotImplementedException(); }