forked from daPhie79/ProgressODoom
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRarProgressBar.cs
31 lines (29 loc) · 1.17 KB
/
RarProgressBar.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.Collections.Generic;
namespace ProgressODoom {
[ToolboxBitmapAttribute(typeof(ProgressODoom.RarProgressBar), "Icons.RarProgressBar.ico")]
public class RarProgressBar : DualProgressBar {
public RarProgressBar() {
this.MasterPainter = new RarProgressPainter(RarProgressPainter.RarProgressType.Silver);
((RarProgressPainter)this.MasterPainter).ShowEdge = false;
this.ProgressPainter = new RarProgressPainter(RarProgressPainter.RarProgressType.Gold);
((RarProgressPainter)this.ProgressPainter).ShowEdge = true;
this.BorderPainter = new RarBorderPainter();
this.BackgroundPainter = new RarBackgroundPainter();
this.PaintMasterFirst = true;
this.OnValueChanged += new EventHandler(onValueChanged);
this.OnMasterValueChanged += new EventHandler(onValueChanged);
}
private void onValueChanged(object sender, EventArgs e) {
bool masterAhead = false;
if (this.MasterValue > this.Value) {
masterAhead = true;
}
((RarProgressPainter)this.MasterPainter).ShowEdge = masterAhead;
((RarProgressPainter)this.ProgressPainter).ShowEdge = !masterAhead;
}
}
}