Exemplo n.º 1
0
        private static int GetMemberNameStartIndex(string memberName, string typeName, string assemblyName)
        {
            var index = 4 + assemblyName.Length;

            if (memberName.Contains(typeName))
            {
                index += typeName.Length;
            }
            else
            {
                index += MemberNameProcessor.GetTypeName(memberName).Length;
            }

            return(index);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Executes name processing of the current &lt;member&gt; element.
        /// </summary>
        /// <param name="writer">The current StringWriter to use.</param>
        /// <param name="root">The current root element to process.</param>
        /// <param name="context">The current processing context.</param>
        /// <returns>The updated processing context.</returns>
        public override Dictionary <XName, string> Process(StringWriter writer, XElement root, Dictionary <XName, string> context)
        {
            Args.IsNotNull(() => writer, () => root, () => context);

            var methodTypeProcessor = this.Registry.Resolve("methodType");

            if (methodTypeProcessor != null)
            {
                context = methodTypeProcessor.Process(writer, root, context);
            }

            var memberName = context["memberName"];
            var memberType = context["memberType"];

            if (memberType != "T")
            {
                int    memberNameStartIndex = MemberNameProcessor.GetMemberNameStartIndex(memberName, context["typeName"], context["assembly"]);
                string shortMemberName      = MemberNameProcessor.GetShortName(memberName, memberType, memberNameStartIndex);
                writer.WriteLine("\n### {0}\n", shortMemberName);
            }

            return(base.Process(writer, root, context));
        }