Exemplo n.º 1
0
        public void SaveSettings()
        {
            var xml = new StringBuilder();

            xml.AppendLine(@"<Settings>");
            if (!String.IsNullOrEmpty(SelectedColor))
            {
                xml.AppendLine(@"<SelectedColor>" + SelectedColor.Replace(@"&", "&#38;").Replace("\"", "&quot;") + @"</SelectedColor>");
            }
            xml.AppendLine(@"<UseSlideMaster>" + UseSlideMaster + @"</UseSlideMaster>");
            xml.AppendLine(@"<BroadcastCalendarSettings>" + BroadcastCalendarSettings.Serialize() + @"</BroadcastCalendarSettings>");
            if (!String.IsNullOrEmpty(SalesRep))
            {
                xml.AppendLine(@"<SalesRep>" + SalesRep.Replace(@"&", "&#38;").Replace("\"", "&quot;") + @"</SalesRep>");
            }
            if (!String.IsNullOrEmpty(SelectedStarOutputItemsEncoded))
            {
                xml.AppendLine(@"<SelectedStarOutputItemsEncoded>" + SelectedStarOutputItemsEncoded.Replace(@"&", "&#38;").Replace("\"", "&quot;") + @"</SelectedStarOutputItemsEncoded>");
            }
            if (!String.IsNullOrEmpty(SelectedShiftOutputItemsEncoded))
            {
                xml.AppendLine(@"<SelectedShiftOutputItemsEncoded>" + SelectedShiftOutputItemsEncoded.Replace(@"&", "&#38;").Replace("\"", "&quot;") + @"</SelectedShiftOutputItemsEncoded>");
            }
            xml.AppendLine(@"<ApplyThemeForAllSlideTypes>" + ApplyThemeForAllSlideTypes + @"</ApplyThemeForAllSlideTypes>");
            xml.AppendLine(_themeSaveHelper.Serialize());
            xml.AppendLine(@"</Settings>");
            using (var sw = new StreamWriter(Asa.Common.Core.Configuration.ResourceManager.Instance.AppSettingsFile.LocalPath, false))
            {
                sw.Write(xml);
                sw.Flush();
            }
        }
        public void SaveSettings()
        {
            var xml = new StringBuilder();

            xml.AppendLine(@"<DashboardSettings>");
            if (!String.IsNullOrEmpty(SalesRep))
            {
                xml.AppendLine(@"<SalesRep>" + SalesRep.Replace(@"&", "&#38;").Replace("\"", "&quot;") + @"</SalesRep>");
            }
            xml.AppendLine(@"<ApplyThemeForAllSlideTypes>" + ApplyThemeForAllSlideTypes + @"</ApplyThemeForAllSlideTypes>");
            xml.AppendLine(_themeSaveHelper.Serialize());
            xml.AppendLine(@"</DashboardSettings>");
            using (var sw = new StreamWriter(Asa.Common.Core.Configuration.ResourceManager.Instance.AppSettingsFile.LocalPath, false))
            {
                sw.Write(xml);
                sw.Flush();
            }
        }