WriteParameters() private static method

private static WriteParameters ( IndentedTextWriter indentedWriter, Dictionary parameterDocs ) : void
indentedWriter System.CodeDom.Compiler.IndentedTextWriter
parameterDocs Dictionary
return void
コード例 #1
0
        private static void WriteCodeTemplates(IList <LanguageProcessor.DocCode> list, IndentedTextWriter indentedWriter, IList <CodeTemplate> templates)
        {
            Dictionary <string, List <string> >       dictionary = new Dictionary <string, List <string> > ((IEqualityComparer <string>)StringComparer.CurrentCultureIgnoreCase);
            Dictionary <string, List <CodeTemplate> > dict       = new Dictionary <string, List <CodeTemplate> > ();

            for (int index = 0; index < templates.Count; ++index)
            {
                string humanString = ((IEnumerable <string>)list [index].languages).ToHumanString <string> ();
                dict.GetOldOrSetNew <string, List <CodeTemplate> > (humanString).Add(templates [index]);
                foreach (TemplateParameter templateParameter in templates[index])
                {
                    dictionary.GetOldOrSetNew <string, List <string> > (templateParameter.name).AddRange((IEnumerable <string>)list [index].parameterDocs [templateParameter.name]);
                }
            }
            foreach (KeyValuePair <string, List <CodeTemplate> > keyValuePair in dict)
            {
                indentedWriter.WriteLine(keyValuePair.Key + ":");
                ++indentedWriter.Indent;
                foreach (CodeTemplate code in keyValuePair.Value)
                {
                    CodeTemplate.WriteDoc((TextWriter)indentedWriter, code);
                }
                --indentedWriter.Indent;
            }
            ++indentedWriter.Indent;
            List <string> stringList = new List <string> ();

            foreach (LanguageProcessor.DocCode docCode in (IEnumerable <LanguageProcessor.DocCode>)list)
            {
                if (docCode.mainDoc.Count > 0)
                {
                    stringList.AddRange((IEnumerable <string>)docCode.mainDoc);
                    break;
                }
            }
            if (stringList.Count > 0)
            {
                indentedWriter.WriteLineNoTabs("");
                foreach (string str in stringList)
                {
                    indentedWriter.WriteLine(str);
                }
            }
            if (dictionary.Count > 0)
            {
                LanguageProcessor.WriteParameters(indentedWriter, dictionary);
            }
            --indentedWriter.Indent;
        }
コード例 #2
0
        private static void WriteTerminatingStringTemplate(IList <LanguageProcessor.DocCode> list, IndentedTextWriter writer, IList <TerminatingStringTemplate> templates)
        {
            Dictionary <string, List <string> > dictionary = new Dictionary <string, List <string> > ((IEqualityComparer <string>)StringComparer.CurrentCultureIgnoreCase);
            Dictionary <string, List <TerminatingStringTemplate> > dict = new Dictionary <string, List <TerminatingStringTemplate> > ();

            for (int index = 0; index < templates.Count; ++index)
            {
                string humanString = ((IEnumerable <string>)list [index].languages).ToHumanString <string> ();
                dict.GetOldOrSetNew <string, List <TerminatingStringTemplate> > (humanString).Add(templates [index]);
                dictionary.GetOldOrSetNew <string, List <string> > (templates [index].Parameter.name).AddRange((IEnumerable <string>)list [index].parameterDocs [templates [index].Parameter.name]);
            }
            foreach (KeyValuePair <string, List <TerminatingStringTemplate> > keyValuePair in dict)
            {
                writer.WriteLine(keyValuePair.Key + ":");
                ++writer.Indent;
                foreach (TerminatingStringTemplate template in keyValuePair.Value)
                {
                    TerminatingStringTemplate.WriteDoc((TextWriter)writer, template);
                }
                --writer.Indent;
            }
            writer.WriteLineNoTabs("");
            ++writer.Indent;
            string[] strArray = (string[])null;
            foreach (LanguageProcessor.DocCode docCode in (IEnumerable <LanguageProcessor.DocCode>)list)
            {
                if (docCode.mainDoc.Count > 0)
                {
                    strArray = docCode.mainDoc.ToArray();
                    break;
                }
            }
            if (strArray != null)
            {
                foreach (string str in list[0].mainDoc)
                {
                    writer.WriteLine(str);
                }
            }
            if (dictionary.Count > 0)
            {
                LanguageProcessor.WriteParameters(writer, dictionary);
            }
            --writer.Indent;
        }