Ejemplo n.º 1
0
        static string[] GetMessageFormat(string section)
        {
            IniHelp iniHelp = new IniHelp();

            string[] keys      = iniHelp.IniReadKeys("UtilityMessageFormats");
            string[] msgFormat = new string[2];
            msgFormat[0] = null;
            msgFormat[1] = null;

            foreach (string s in keys)
            {
                if (s.ToLower() == section.ToLower() + "_format")
                {
                    msgFormat[0] = iniHelp.IniReadValue("UtilityMessageFormats", s);
                }
                if (s.ToLower() == section.ToLower() + "_varnames")
                {
                    msgFormat[1] = iniHelp.IniReadValue("UtilityMessageFormats", s);
                }
            }
            return(msgFormat);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// method to write the key value pairs to the console and form xml string to pass to the notification engine
        /// </summary>
        /// <param name="section"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        static string WriteKeyValue(string section, string message)
        {
            IniHelp       iniHelp = new IniHelp();
            StringBuilder sb      = new StringBuilder();

            string[] keys = iniHelp.IniReadKeys(section);

            if (keys == null)
            {
                return(null);
            }

            sb = AddHeader(sb, section, message);
            sb.Append("<notificationSettings>");
            foreach (string s in keys)
            {
                sb.Append("<" + s + ">" + "<![CDATA[" + iniHelp.IniReadValue(section, s).Trim() + "]]></" + s + ">");
                WriteLine(s + ":" + iniHelp.IniReadValue(section, s) + "\n");
            }
            sb.Append("</notificationSettings></notification>");

            return(sb.ToString());
        }