コード例 #1
0
        private void WriteTemplateType(TemplateTypeReference template, DisplayOptions options, XmlWriter writer, Dictionary <IndexedTemplateTypeReference, TypeReference> dictionary)
        {
            // if we have the name, just write it
            NamedTemplateTypeReference namedTemplate = template as NamedTemplateTypeReference;

            if (namedTemplate != null)
            {
                writer.WriteString(namedTemplate.Name);
                return;
            }

            IndexedTemplateTypeReference indexedTemplate = template as IndexedTemplateTypeReference;

            if (indexedTemplate != null)
            {
                if (dictionary != null && dictionary.ContainsKey(indexedTemplate))
                {
                    WriteType(dictionary[indexedTemplate], options, writer);
                }
                else
                {
                    writer.WriteString(GetTemplateName(indexedTemplate.TemplateId, indexedTemplate.Index));
                }

                return;
            }

            TypeTemplateTypeReference typeTemplate = template as TypeTemplateTypeReference;

            if (typeTemplate != null)
            {
                TypeReference value = null;

                if (dictionary != null)
                {
                    IndexedTemplateTypeReference key = new IndexedTemplateTypeReference(typeTemplate.TemplateType.Id, typeTemplate.Position);

                    if (dictionary.ContainsKey(key))
                    {
                        value = dictionary[key];
                    }
                }

                if (value == null)
                {
                    writer.WriteString(GetTypeTemplateName(typeTemplate.TemplateType, typeTemplate.Position));
                }
                else
                {
                    WriteType(value, options, writer);
                }

                return;
            }

            throw new InvalidOperationException("Unknown template type");
        }
コード例 #2
0
        internal static void WriteSimpleMemberReference(SimpleMemberReference member, DisplayOptions options, XmlWriter writer, LinkTextResolver resolver)
        {
            string cer = member.Id;

            string typeCer, memberName, arguments;

            DecomposeMemberIdentifier(cer, out typeCer, out memberName, out arguments);

            if ((options & DisplayOptions.ShowContainer) > 0)
            {
                SimpleTypeReference type = CreateSimpleTypeReference(typeCer);
                WriteSimpleTypeReference(type, options & ~DisplayOptions.ShowContainer, writer);
                writer.WriteString(".");
            }

            // Change this so that we deal with EII names correctly, too
            writer.WriteString(memberName);

            if ((options & DisplayOptions.ShowParameters) > 0)
            {
                if (String.IsNullOrEmpty(arguments))
                {
                    Parameter[] parameters = new Parameter[0];
                    resolver.WriteMethodParameters(parameters, writer);
                }
                else
                {
                    IList <string> parameterTypeCers = SeparateTypes(arguments);
                    Parameter[]    parameters        = new Parameter[parameterTypeCers.Count];

                    for (int i = 0; i < parameterTypeCers.Count; i++)
                    {
                        TypeReference parameterType = CreateTypeReference(parameterTypeCers[i]);

                        if (parameterType == null)
                        {
                            parameterType = new NamedTemplateTypeReference("UAT");
                        }

                        parameters[i] = new Parameter(String.Empty, parameterType);
                    }

                    resolver.WriteMethodParameters(parameters, writer);
                }
            }
        }
コード例 #3
0
        internal static void WriteSimpleMemberReference(SimpleMemberReference member, DisplayOptions options, XmlWriter writer, LinkTextResolver resolver)
        {
            string cer = member.Id;

            string typeCer, memberName, arguments;
            DecomposeMemberIdentifier(cer, out typeCer, out memberName, out arguments);

            if((options & DisplayOptions.ShowContainer) > 0)
            {
                SimpleTypeReference type = CreateSimpleTypeReference(typeCer);
                WriteSimpleTypeReference(type, options & ~DisplayOptions.ShowContainer, writer);
                writer.WriteString(".");
            }

            // Change this so that we deal with EII names correctly, too
            writer.WriteString(memberName);

            if((options & DisplayOptions.ShowParameters) > 0)
            {
                if(String.IsNullOrEmpty(arguments))
                {
                    Parameter[] parameters = new Parameter[0];
                    resolver.WriteMethodParameters(parameters, writer);
                }
                else
                {
                    IList<string> parameterTypeCers = SeparateTypes(arguments);
                    Parameter[] parameters = new Parameter[parameterTypeCers.Count];

                    for(int i = 0; i < parameterTypeCers.Count; i++)
                    {
                        TypeReference parameterType = CreateTypeReference(parameterTypeCers[i]);

                        if(parameterType == null)
                            parameterType = new NamedTemplateTypeReference("UAT");

                        parameters[i] = new Parameter(String.Empty, parameterType);
                    }

                    resolver.WriteMethodParameters(parameters, writer);
                }
            }
        }