adding more rooted events to event EventHandler
This commit is contained in:
parent
5232361758
commit
8c2f2314dd
5 changed files with 19 additions and 28 deletions
|
|
@ -65,7 +65,7 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
DisplayCurrentTemperature();
|
||||
}
|
||||
printer.Connection.BedTemperatureRead += DisplayTemp;
|
||||
printer.Disposed += (s, e) => printer.Connection.BedTemperatureRead += DisplayTemp;
|
||||
this.Closed += (s, e) => printer.Connection.BedTemperatureRead -= DisplayTemp;
|
||||
}
|
||||
|
||||
protected override int ActualTemperature => (int)printer.Connection.ActualBedTemperature;
|
||||
|
|
|
|||
|
|
@ -201,7 +201,12 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
|
||||
this.PopupContent = this.GetPopupContent(ApplicationController.Instance.MenuTheme);
|
||||
|
||||
printer.Connection.HotendTemperatureRead.RegisterEvent((s, e) => DisplayCurrentTemperature(), ref unregisterEvents);
|
||||
void DisplayTemp(object s, EventArgs e)
|
||||
{
|
||||
DisplayCurrentTemperature();
|
||||
}
|
||||
printer.Connection.BedTemperatureRead += DisplayTemp;
|
||||
this.Closed += (s, e) => printer.Connection.BedTemperatureRead -= DisplayTemp;
|
||||
}
|
||||
|
||||
protected override int ActualTemperature => (int)printer.Connection.GetActualHotendTemperature(this.hotendIndex);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue