Source/NFX/Environment/Attributes.cs
/// <summary>
/// Generates 2 attribute paths for named member. This first path is just the member name converted to lower case.
/// The seconfd path is "OR"ed with the first one and is taken from member name where all case transitions are prefixed with "-".
/// For private fields 'm_' and 's_' prefixes are removed
/// </summary>
Generates 2 attribute paths for named member. This first path is just the member name converted to lower case.
The seconfd path is "OR"ed with the first one and is taken from member name where all case transitions are prefixed with "-".
For private fields 'm_' and 's_' prefixes are removed
Generates 2 attribute paths for named member . This first path is just the member name converted to lower case . The seconfd path is " OR " ed with the first one and is taken from member name where all case transitions are prefixed with " - " . For private fields ' m_ ' and ' s_ ' prefixes are removed
public static string GetConfigPathsForMember(MemberInfo member)
       {
           var mn = member.Name;
           if (member is FieldInfo)
           {
                var fi = (FieldInfo)member;
                if (fi.IsPrivate)
                {
                    if (mn.StartsWith("m_", StringComparison.InvariantCulture) ||
                        mn.StartsWith("s_", StringComparison.InvariantCulture)) mn = mn.Remove(0, 2);
                }
           }
           var sb = new StringBuilder();
           var first = true;
           var plc = false;
           foreach(var c in mn)
           {
                var clc = char.IsLower(c);
                if (!first && !clc && plc && c!='-') sb.Append('-');
                sb.Append(c);
                first = false;
                plc = clc;
           }
           return "${0}|${1}".Args(mn.ToLowerInvariant(), sb.ToString().ToLowerInvariant());
       }
public static string GetConfigPathsForMember ( MemberInfo member ) { var mn = member . Name ; if ( member is FieldInfo ) { var fi = ( FieldInfo ) member ; if ( fi . IsPrivate ) { if ( mn . StartsWith ( " " , StringComparison . InvariantCulture ) || mn . StartsWith ( " " , StringComparison . InvariantCulture ) ) mn = mn . Remove ( 0 , 2 ) ; } } var sb = new StringBuilder ( ) ; var first = true ; var plc = false ; foreach ( var c in mn ) { var clc = char . IsLower ( c ) ; if ( ! first && ! clc && plc && c != ' ' ) sb . Append ( ' ' ) ; sb . Append ( c ) ; first = false ; plc = clc ; } return " " . Args ( mn . ToLowerInvariant ( ) , sb . ToString ( ) . ToLowerInvariant ( ) ) ; }
Generates 2 attribute paths for named member.
Generates 2 attribute paths for named member .
member
MemberInfo