Skip to content

Instantly share code, notes, and snippets.

@dislogical
Created March 13, 2012 01:21
Show Gist options
  • Select an option

  • Save dislogical/2026008 to your computer and use it in GitHub Desktop.

Select an option

Save dislogical/2026008 to your computer and use it in GitHub Desktop.
Interface between List and Queue to hide certain methods.
namespace YOUR_PROJECT_NAMESPACE
{
/// <summary>
/// Class that hides List's methods from Queue</summary>
/// <typeparam name="T">
/// Type of Queue</typeparam>
/// <author>Colden Cullen</author>
abstract class QueueSaver<T> : List<T>
{
public override sealed void Add( T data ) { }
public override sealed void AddFront( T data ) { }
public override sealed bool Remove( T data )
{
return false;
}
public override sealed bool RemoveAt( int index )
{
return false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment