/// <summary> /// Получение параметров печати /// </summary> public static YayPrintSettings GetSavedPrintSettings() { string xmlpath = ActivateFolder(); YayPrintSettings ps; XmlSerializer serializer = new XmlSerializer(typeof(YayPrintSettings)); if (File.Exists(xmlpath)) { using (StreamReader reader = new StreamReader(xmlpath)) { ps = (YayPrintSettings)serializer.Deserialize(reader); if (ps == null) { TaskDialog.Show("Внимание", "Не удалось получить сохраненные настройки печати"); Debug.WriteLine("Unable to get print setiings, set to default"); ps = new YayPrintSettings(); } } } else { ps = new YayPrintSettings(); } if (ps.excludeColors == null || ps.excludeColors.Count == 0) { ps.excludeColors = YayPrintSettings.GetStandardExcludeColors(); } return(ps); }
private void buttonReset_Click(object sender, EventArgs e) { Colors = YayPrintSettings.GetStandardExcludeColors(); RefreshColors(); }