public CounterComponent(LiveSplitState state) { VerticalHeight = 10; Settings = new CounterComponentSettings(); Cache = new GraphicsCache(); CounterNameLabel = new SimpleLabel(); Counter = new Counter(); this.state = state; Settings.CounterReinitialiseRequired += Settings_CounterReinitialiseRequired; Settings.IncrementUpdateRequired += Settings_IncrementUpdateRequired; // Subscribe to input hooks. Settings.Hook.KeyOrButtonPressed += hook_KeyOrButtonPressed; }
/// <summary> /// Handles the CounterReinitialiseRequired event of the Settings control. /// </summary> private void Settings_CounterReinitialiseRequired(object sender, EventArgs e) { Counter = new Counter(Settings.InitialValue, Settings.Increment); }
public void SetSettings(System.Xml.XmlNode settings) { Settings.SetSettings(settings); // Initialise Counter from settings. Counter = new Counter(Settings.InitialValue, Settings.Increment); }