mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-02 21:20:28 +12:00
SettingsSavedEventHandler
This commit is contained in:
parent
84dd0b8d17
commit
7c778ad610
|
@ -37,6 +37,9 @@ public abstract class SettingsBase<T> where T : SettingsBase<T>, new()
|
|||
public delegate void SettingsChangedEventHandler(object sender, EventArgs e);
|
||||
public event SettingsChangedEventHandler SettingsChanged;
|
||||
|
||||
public delegate void SettingsSavedEventHandler(object sender, EventArgs e);
|
||||
public event SettingsSavedEventHandler SettingsSaved;
|
||||
|
||||
[Browsable(false)]
|
||||
public string FilePath { get; private set; }
|
||||
|
||||
|
@ -67,11 +70,18 @@ public virtual void OnSettingsChanged(EventArgs e)
|
|||
SettingsChanged(this, e);
|
||||
}
|
||||
|
||||
protected virtual void OnSettingsSaved(EventArgs e)
|
||||
{
|
||||
if (SettingsSaved != null)
|
||||
SettingsSaved(this, e);
|
||||
}
|
||||
|
||||
public bool Save(string filePath)
|
||||
{
|
||||
FilePath = filePath;
|
||||
ApplicationVersion = Application.ProductVersion;
|
||||
|
||||
OnSettingsSaved(EventArgs.Empty);
|
||||
return SaveInternal(this, FilePath, true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue