// Put return type after the signature
 public override string GetMethodSignature(IMethodReference method, NameFormattingOptions formattingOptions)
 {
     string baseSig = base.GetMethodSignature(method, (formattingOptions & ~NameFormattingOptions.ReturnType));
     StringBuilder sb = new StringBuilder(baseSig);
     AppendReturnTypeSignature(method, (formattingOptions | NameFormattingOptions.ReturnType), sb);
     return sb.ToString();
 }
        // Append "@" to a byref param's type
        protected override void AppendParameter(IParameterTypeInformation param, NameFormattingOptions formattingOptions, StringBuilder sb)
        {
            // HACK: This is to support CCI1 syntax where generic type arguments are not shown for nested types.
            if (param.Type is INestedTypeReference) formattingOptions = formattingOptions | NameFormattingOptions.OmitTypeArguments;

            base.AppendParameter(param, (formattingOptions & ~NameFormattingOptions.OmitContainingType), sb);

            if (param.IsByReference) sb.Append('@');

            if (param.IsModified)
            {
                int count = 0;
                foreach (ICustomModifier modifier in param.CustomModifiers)
                {
                    count++;
                    //if (count>1)
                    //{ throw new NotImplementedException("Can't create a signature with more than one custom modifier"); }
                    AppendCustomModifier(formattingOptions, sb, modifier);
                }
            }
        }
 protected virtual void AppendMethodModifiers(IMethodReference method, NameFormattingOptions formattingOptions, StringBuilder sb)
 {
 }
        // Append return type only on op_Explicit methods
        protected override void AppendReturnTypeSignature(ISignature sig, NameFormattingOptions formattingOptions, StringBuilder sb)
        {
            if ((formattingOptions & NameFormattingOptions.ReturnType) == 0) return;
            ITypeMemberReference member = sig as ITypeMemberReference;
            // TODO: Review
            //if (sig.CallingConvention != CallingConvention.Default)
            //{
            //    sb.Append(' ');
            //    sb.Append(sig.CallingConvention);
            //}
            if (sig.ReturnValueIsModified)
            {
                foreach (ICustomModifier modifier in sig.ReturnValueCustomModifiers)
                {
                    AppendCustomModifier(formattingOptions, sb, modifier);
                }
            }
            //===========

            if (member == null || (member.Name.Value != "op_Explicit" && member.Name.Value != "op_Implicit")) return;

            sb.Append(" : ");
            sb.Append(_formatter.GetTypeName(sig.Type, formattingOptions & ~NameFormattingOptions.OmitContainingType));
        }
 // ".ctor" -> "#ctor". NOTE: ".cctor" is unchanged
 protected override void AppendMethodName(IMethodReference method, NameFormattingOptions formattingOptions, StringBuilder sb)
 {
     base.AppendMethodName(method, formattingOptions, sb);
     sb.Replace(".ctor", "#ctor");
 }
 private void AppendCustomModifier(NameFormattingOptions formattingOptions, StringBuilder sb, ICustomModifier modifier)
 {
     sb.Append(' ');
     sb.Append(modifier.IsOptional ? "modopt" : "modreq");
     sb.Append('(');
     sb.Append(_formatter.GetTypeName(modifier.Modifier, formattingOptions & ~NameFormattingOptions.OmitContainingType));
     sb.Append(')');
 }