/// <summary> /// Returns the XMPP element name of the specified general activity value. /// </summary> /// <param name="activity">A value from the GeneralActivity enumeration /// to convert into an element name.</param> /// <returns>The XML element name of the specified activity value.</returns> private string GeneralActivityToTagName(GeneralActivity activity) { StringBuilder b = new StringBuilder(); string s = activity.ToString(); for (int i = 0; i < s.Length; i++) { if (char.IsUpper(s, i) && i > 0) { b.Append('_'); } b.Append(char.ToLower(s[i])); } return(b.ToString()); }
/// <summary> /// Returns the XMPP element name of the specified general activity value. /// </summary> /// <param name="activity">A value from the GeneralActivity enumeration /// to convert into an element name.</param> /// <returns>The XML element name of the specified activity value.</returns> string GeneralActivityToTagName(GeneralActivity activity) { StringBuilder b = new StringBuilder(); string s = activity.ToString(); for (int i = 0; i < s.Length; i++) { if (Char.IsUpper(s, i) && i > 0) b.Append('_'); b.Append(Char.ToLower(s[i])); } return b.ToString(); }