Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4424 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
8 changed files with 130 additions and 23 deletions
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System; |
||||
|
||||
namespace Debugger.AddIn.Visualizers.Utils |
||||
{ |
||||
/// <summary>
|
||||
/// Description of LinqUtils.
|
||||
/// </summary>
|
||||
public static class LinqUtils |
||||
{ |
||||
public static int MaxOrDefault<TSource>(this IEnumerable<TSource> source, Func<TSource, int> selector, int defaultValue) |
||||
{ |
||||
if (source.Count() == 0) |
||||
return defaultValue; |
||||
|
||||
return source.Max(selector); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Text; |
||||
|
||||
namespace Debugger.AddIn.Visualizers.Utils |
||||
{ |
||||
/// <summary>
|
||||
/// Description of StringHelper.
|
||||
/// </summary>
|
||||
public class StringHelper |
||||
{ |
||||
public static string Repeat(char c, int count) |
||||
{ |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.Append(c, count); |
||||
return sb.ToString(); |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue