Exemplo n.º 1
0
        /// <summary>
        /// Replaces the specified locale string with the new value.
        /// </summary>
        /// <param name="id">Comma-separated path to the existing locale string.</param>
        /// <param name="value">The new string.</param>
        /// <remarks>
        /// Use this method if you want to replace some existing locale value with the new one.
        /// </remarks>
        /// <example>
        /// <code>
        /// Res.Set("Messages,SaveChanges", "My text that will appear when you close the designer");
        /// </code>
        /// </example>
        public static void Set(string id, string value)
        {
            string[] categories = id.Split(new char[] { ',' });
            XmlItem  xi         = FLocale.Root;

            foreach (string category in categories)
            {
                xi = xi.FindItem(category);
            }

            xi.SetProp("Text", value);
        }