#develop (short for SharpDevelop) is a free IDE for .NET programming languages.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
625 B

// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Markus Palme" email="MarkusPalme@gmx.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
namespace ICSharpCode.VBNetBinding
{
public static class Extensions
{
public static T PeekOrDefault<T>(this Stack<T> stack)
{
if (stack.Count > 0)
return stack.Peek();
return default(T);
}
public static T PopOrDefault<T>(this Stack<T> stack)
{
if (stack.Count > 0)
return stack.Pop();
return default(T);
}
}
}