Skip to content

Instantly share code, notes, and snippets.

View jamesmanning's full-sized avatar

James Manning jamesmanning

View GitHub Profile
@jamesmanning
jamesmanning / IEnumerableWithCount.cs
Created March 4, 2012 18:49
declaration of IEnumerableWithCount<T>
namespace System.Collections.Generic
{
public interface IEnumerableWithCount<out T> : IEnumerable<T>
{
int Count { get; }
}
}
@jamesmanning
jamesmanning / Enumerable.cs
Created March 4, 2012 19:17
Existing ToArray declarion in Enumerable
public static TSource[] ToArray<TSource>(this IEnumerable<TSource> source)
{
if (source != null)
{
Buffer<TSource> buffer = new Buffer<TSource>(source);
return buffer.ToArray();
}
else
{
throw Error.ArgumentNull("source");
@jamesmanning
jamesmanning / Buffer.cs
Created March 4, 2012 19:27
ctor for Buffer
internal Buffer(IEnumerable<TElement> source)
{
TElement[] tElementArray = null;
int count = 0;
ICollection<TElement> tElements = source as ICollection<TElement>;
if (tElements == null)
{
foreach (TElement tElement in source)
{
if (tElementArray != null)
using System;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
namespace ItsBigItsHeavyItsWood
{
class Program
{
static void Main()
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
namespace ConsoleApplication13
{
class Program
{
using System;
using System.Linq;
using System.Threading.Tasks;
using log4net;
using log4net.Config;
namespace ItsBigItsHeavyItsWood
{
class Program
{
using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections;
using System.Threading;
class Program
{
static void Main(string[] args)
{
using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
class Program
{
static void Main(string[] args)
using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using log4net;
using log4net.Config;
class Program
using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
using log4net;
using log4net.Config;
class Program