Beispiel #1
0
        public void ReplaceText(string find, string replace)
        {
            find = find.Replace("<", "&lt;");
            find = find.Replace(">", "&gt;");
            string xml = OuterXml.Replace(find, replace);

            if (xml != "")
            {
                LoadXml(xml);
            }
        }
Beispiel #2
0
        private void SaveFile()
        {
            StreamWriter writer = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\" + FILE_NAME);
            string       xml    = OuterXml.Replace(@"\n", @"&#10;");

            if (!xml.Contains(@"<?mso-application progid=""Word.Document""?>"))
            {
                xml = @"<?mso-application progid=""Word.Document""?>" + xml;
            }
            if (!xml.Contains(@"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?>"))
            {
                xml = @"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?>" + xml;
            }
            writer.Write(xml);
            writer.Close();
        }