Added mainboard specific configurations for the following Gigabyte mainboards: EX58-UD3R, G41M-Combo, G41MT-S2, G41MT-S2P, GA-MA770T-UD3P, GA-MA785GM-US2H, GA-MA78LM-S2H, GA-MA790X-UD3P, H55-USB3, H55N-USB3, H61M-DS2 REV 1.2, H61M-USB3-B3 REV 2.0, H67A-USB3-B3, P55A-UD3, P67A-UD3-B3, P67A-UD3R-B3, Z68A-D3H-B3, Z68AP-D3, Z68X-UD3H-B3.
2 using System.Collections.Generic;
5 using System.Threading;
6 using System.Windows.Forms;
8 namespace Aga.Controls.Tree.NodeControls
11 /// Displays an animated icon for those nodes, who are in expanding state.
12 /// Parent TreeView must have AsyncExpanding property set to true.
14 public class ExpandingIcon: NodeControl
16 private static GifDecoder _gif = ResourceHelper.LoadingIcon;
17 private static int _index = 0;
18 private static volatile Thread _animatingThread;
19 private static object _lock = new object();
21 public override Size MeasureSize(TreeNodeAdv node, DrawContext context)
23 return ResourceHelper.LoadingIcon.FrameSize;
26 protected override void OnIsVisibleValueNeeded(NodeControlValueEventArgs args)
28 args.Value = args.Node.IsExpandingNow;
29 base.OnIsVisibleValueNeeded(args);
32 public override void Draw(TreeNodeAdv node, DrawContext context)
34 Rectangle rect = GetBounds(node, context);
35 Image img = _gif.GetFrame(_index).Image;
36 context.Graphics.DrawImage(img, rect.Location);
39 public static void Start()
43 if (_animatingThread == null)
46 _animatingThread = new Thread(new ThreadStart(IterateIcons));
47 _animatingThread.IsBackground = true;
48 _animatingThread.Priority = ThreadPriority.Lowest;
49 _animatingThread.Start();
54 public static void Stop()
59 _animatingThread = null;
63 private static void IterateIcons()
65 while (_animatingThread != null)
67 if (_index < _gif.FrameCount - 1)
72 if (IconChanged != null)
73 IconChanged(null, EventArgs.Empty);
75 int delay = _gif.GetFrame(_index).Delay;
78 System.Diagnostics.Debug.WriteLine("IterateIcons Stopped");
81 public static event EventHandler IconChanged;