Convert static SettingChanged event to instance based

issue: MatterHackers/MCCentral#4551
This commit is contained in:
Lars Brubaker 2018-11-12 17:20:59 -08:00
parent b38abfaad4
commit 6405dad7ac
23 changed files with 111 additions and 87 deletions

View file

@ -319,7 +319,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
}
};
PrinterSettings.SettingChanged.RegisterEvent((s, e) =>
void Printer_SettingChanged(object s, EventArgs e)
{
if (e is StringEventArgs stringEvent)
{
@ -336,8 +336,9 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
}
}
}
},
ref unregisterEvents);
}
printer.Settings.SettingChanged += Printer_SettingChanged;
this.Closed -= Printer_SettingChanged;
}
this.PerformLayout();