WingMan

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 12  →  ?path2? @ 14
/trunk/WingMan/Utilities/AES.cs
@@ -1,5 +1,4 @@
using System;
using System.IO;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
/trunk/WingMan/Utilities/Extensions.cs
@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
 
namespace WingMan.Utilities
{
public static class Extensions
{
/// <summary>
/// Sequentially removes all the elements from the first sequence that are in the second sequence.
/// </summary>
/// <typeparam name="T">the type o the collection</typeparam>
/// <param name="o">the first sequence to remove from</param>
/// <param name="p">the second sequence to remove</param>
/// <returns>the first sequence excluding the second sequence</returns>
public static IEnumerable<T> SequenceExcept<T>(this IEnumerable<T> a, IEnumerable<T> b) where T : IEquatable<T>
{
using (var ea = a.GetEnumerator())
{
using (var eb = b.GetEnumerator())
{
while (ea.MoveNext())
{
if (eb.MoveNext() && ea.Current.Equals(eb.Current))
continue;
yield return ea.Current;
}
}
}
}
 
/// <summary>
/// Determines whether a sequence is contained within another sequence.
/// </summary>
/// <returns>true if and only if the first set is contained in the second set</returns>
/// <param name="a">The set to check</param>
/// <param name="b">The set to check against</param>
/// <typeparam name="T">the set type</typeparam>
public static bool SubsetEquals<T>(this IEnumerable<T> a, IEnumerable<T> b) where T : IEquatable<T>
{
return !a.OrderBy(s => s).SequenceExcept(b.OrderBy(s => s)).Any();
}
}
}
/trunk/WingMan/Utilities/KeyConversion.cs
@@ -1,26 +1,9 @@
using System.Collections.Generic;
using System.Windows.Forms;
 
namespace WingMan
namespace WingMan.Utilities
{
public static class KeyConversion
{
public static readonly Dictionary<MouseButtons, string> MouseButtonsToString =
new Dictionary<MouseButtons, string>
{
{MouseButtons.Left, "Left Mouse Button"},
{MouseButtons.Middle, "Middle Mouse Button"},
{MouseButtons.Right, "Right Mouse Button"}
};
 
public static readonly Dictionary<string, MouseButtons> StringToMouseButtons =
new Dictionary<string, MouseButtons>
{
{"Left Mouse Button", MouseButtons.Left},
{"Middle Mouse Button", MouseButtons.Middle},
{"Right Mouse Button", MouseButtons.Right}
};
 
public static readonly Dictionary<string, byte> StringToKeys = new Dictionary<string, byte>
{
{"None", 0},