Exemple #1
0
        public override string ToString()
        {
            string methodString = "";

            if (Modifiers.HasFlag(MethodModifiers.Static))
            {
                methodString += $"{DeclaringType.ShortName}.";
            }

            methodString += Name;

            string argTypeString = string.Join(", ", Parameters.Select(a => a.Value.ShortName));

            methodString += $"({argTypeString})";

            if (GenericArguments.Count > 0)
            {
                string genArgTypeString = string.Join(", ", GenericArguments.Select(s => s.ShortName));
                methodString += $"<{genArgTypeString}>";
            }

            if (ReturnTypes.Count > 0)
            {
                string returnTypeString = string.Join(", ", ReturnTypes.Select(s => s.ShortName));
                methodString += $" : {returnTypeString}";
            }

            return(methodString);
        }
        public void ExportToTree(
            TextWriter writer,
            string currentIndent,
            string indent,
            out IEnumerable <IAnalysisItemView> exportChildren
            )
        {
            var returnTypes = string.Join(", ", ReturnTypes.Select(t => {
                var sw = new StringWriter();
                IEnumerable <IAnalysisItemView> dummy;
                t.ExportToTree(sw, "", indent, out dummy);
                return("(" + sw.ToString().Trim() + ")");
            }).Distinct());

            if (!string.IsNullOrEmpty(returnTypes))
            {
                writer.WriteLine("{0}Overload: {1} -> {2}", currentIndent, Prototype, returnTypes);
            }
            else
            {
                writer.WriteLine("{0}Overload: {1}", currentIndent, Prototype);
            }
            exportChildren = null;
        }