Пример #1
0
 /// <summary>
 /// Writes the method's signature into a <see cref="StringBuilder"/>.
 /// </summary>
 /// <param name="m">This <see cref="ISimpleMethodInfo"/>.</param>
 /// <returns>The string builder (to allow fluent syntax).</returns>
 public static StringBuilder AppendSimpleSignature(this ISimpleMethodInfo m, StringBuilder b)
 {
     b.Append(m.ReturnType).Append(' ').Append(m.Name).Append('(');
     foreach (var p in m.Parameters)
     {
         b.Append(p.ParameterType).Append(',');
     }
     b.Length = b.Length - 1;
     b.Append(')');
     return(b);
 }
Пример #2
0
        public static VMLogMethodConfig CreateFrom( VMLogServiceConfig holder, ISimpleMethodInfo m )
        {
            VMLogMethodConfig result = new VMLogMethodConfig( holder, m.Name, true );

            result.ReturnType = m.ReturnType.ToString();
            foreach( ISimpleParameterInfo p in m.Parameters )
            {
                result.Parameters.Add( new LogParameterInfo( p.ParameterName, p.ParameterType ) );
            }

            result.LogOptions = result.Config.User.GetOrSet( result._logOptionsDataPath, ServiceLogMethodOptions.LogError );
            result.DoLog = result.Config.User.GetOrSet( result._doLogDataPath, true );

            return result;
        }
Пример #3
0
 /// <summary>
 /// Gets the method's signature.
 /// </summary>
 /// <param name="m">This <see cref="ISimpleMethodInfo"/>.</param>
 /// <returns>The signature (return type, name and parameter types, types are ).</returns>
 public static string GetSimpleSignature(this ISimpleMethodInfo m)
 {
     return(AppendSimpleSignature(m, new StringBuilder()).ToString());
 }