1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/External/Aga.Controls/ResourceHelper.cs Sun May 27 15:16:19 2012 +0000
1.3 @@ -0,0 +1,48 @@
1.4 +using System;
1.5 +using System.IO;
1.6 +using System.Reflection;
1.7 +using System.Windows.Forms;
1.8 +using System.Collections.Generic;
1.9 +using System.Text;
1.10 +
1.11 +namespace Aga.Controls
1.12 +{
1.13 + public static class ResourceHelper
1.14 + {
1.15 + // VSpilt Cursor with Innerline (symbolisize hidden column)
1.16 + private static Cursor _dVSplitCursor = GetCursor(Properties.Resources.DVSplit);
1.17 + public static Cursor DVSplitCursor
1.18 + {
1.19 + get { return _dVSplitCursor; }
1.20 + }
1.21 +
1.22 + private static GifDecoder _loadingIcon = GetGifDecoder(Properties.Resources.loading_icon);
1.23 + public static GifDecoder LoadingIcon
1.24 + {
1.25 + get { return _loadingIcon; }
1.26 + }
1.27 +
1.28 + /// <summary>
1.29 + /// Help function to convert byte[] from resource into Cursor Type
1.30 + /// </summary>
1.31 + /// <param name="data"></param>
1.32 + /// <returns></returns>
1.33 + private static Cursor GetCursor(byte[] data)
1.34 + {
1.35 + using (MemoryStream s = new MemoryStream(data))
1.36 + return new Cursor(s);
1.37 + }
1.38 +
1.39 + /// <summary>
1.40 + /// Help function to convert byte[] from resource into GifDecoder Type
1.41 + /// </summary>
1.42 + /// <param name="data"></param>
1.43 + /// <returns></returns>
1.44 + private static GifDecoder GetGifDecoder(byte[] data)
1.45 + {
1.46 + using(MemoryStream ms = new MemoryStream(data))
1.47 + return new GifDecoder(ms, true);
1.48 + }
1.49 +
1.50 + }
1.51 +}