Skip to content

Commit

Permalink
Read and write auto-dismiss options
Browse files Browse the repository at this point in the history
  • Loading branch information
r-smith committed Feb 23, 2021
1 parent 0d81e07 commit 245d843
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions vmPing/Classes/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,14 @@ private static XmlElement GenerateConfigurationNode(XmlDocument xd)
xmlDocument: xd,
name: "PopupNotifications",
value: ApplicationOptions.PopupOption.ToString()));
configuration.AppendChild(GenerateOptionNode(
xmlDocument: xd,
name: "IsAutoDismissEnabled",
value: ApplicationOptions.IsAutoDismissEnabled.ToString()));
configuration.AppendChild(GenerateOptionNode(
xmlDocument: xd,
name: "AutoDismissMilliseconds",
value: ApplicationOptions.AutoDismissMilliseconds.ToString()));
configuration.AppendChild(GenerateOptionNode(
xmlDocument: xd,
name: "IsEmailAlertEnabled",
Expand Down Expand Up @@ -558,6 +566,14 @@ private static void LoadConfigurationNode(XmlNodeList nodeList)
else
ApplicationOptions.PopupOption = ApplicationOptions.PopupNotificationOption.Never;
}
if (options.TryGetValue("IsAutoDismissEnabled", out optionValue))
{
ApplicationOptions.IsAutoDismissEnabled = bool.Parse(optionValue);
}
if (options.TryGetValue("AutoDismissMilliseconds", out optionValue))
{
ApplicationOptions.AutoDismissMilliseconds = int.Parse(optionValue);
}
if (options.TryGetValue("IsEmailAlertEnabled", out optionValue))
{
ApplicationOptions.IsEmailAlertEnabled = bool.Parse(optionValue);
Expand Down

0 comments on commit 245d843

Please sign in to comment.