コード例 #1
0
ファイル: SignalReference.cs プロジェクト: qxp1011/gsf
        /// <summary>
        /// Returns a <see cref="string"/> that represents the specified <paramref name="acronym"/>, <see cref="SignalKind"/> and <paramref name="index"/>.
        /// </summary>
        /// <param name="acronym">Acronym portion of the desired <see cref="string"/> representation.</param>
        /// <param name="type"><see cref="SignalKind"/> portion of the desired <see cref="string"/> representation.</param>
        /// <param name="index">Index of <see cref="SignalKind"/> portion of the desired <see cref="string"/> representation.</param>
        /// <returns>A <see cref="string"/> that represents the specified <paramref name="acronym"/>, <see cref="SignalKind"/> and <paramref name="index"/>.</returns>
        public static string ToString(string acronym, SignalKind type, int index)
        {
            if (index > 0)
            {
                return(string.Format("{0}-{1}{2}", acronym, type.GetAcronym(), index));
            }

            return(string.Format("{0}-{1}", acronym, type.GetAcronym()));
        }
コード例 #2
0
 /// <summary>
 /// Returns a <see cref="string"/> that represents the specified <paramref name="acronym"/>, <see cref="SignalKind"/> and <paramref name="index"/>.
 /// </summary>
 /// <param name="acronym">Acronym portion of the desired <see cref="string"/> representation.</param>
 /// <param name="type"><see cref="SignalKind"/> portion of the desired <see cref="string"/> representation.</param>
 /// <param name="index">Index of <see cref="SignalKind"/> portion of the desired <see cref="string"/> representation.</param>
 /// <returns>A <see cref="string"/> that represents the specified <paramref name="acronym"/>, <see cref="SignalKind"/> and <paramref name="index"/>.</returns>
 public static string ToString(string acronym, SignalKind type, int index) =>
 $"{acronym}-{type.GetAcronym()}{(index > 0 ? $"{index}" : "")}";