Esempio n. 1
0
        public string GenerateHTMLProperty(string txtContent)
        {
            string htmlString = txtContent;

            var myData = new TemplateData_Base
            {
                m_class       = "Color",
                m_member      = "r",
                m_type        = "float",
                m_description = "Red component of the color.",
                m_examples    = new List <Example>()
            };

            var item1 = new Example {
                m_languageID = ScriptLanguageID.JavaScript, m_expression = "c=a+b"
            };

            myData.m_examples.Add(item1);

            var item2 = new Example {
                m_languageID = ScriptLanguageID.JavaScript, m_expression = "d=a*b"
            };

            myData.m_examples.Add(item2);

            var page = new PropertyTemplate(myData);

            htmlString = page.TransformText();
            //System.IO.File.WriteAllText("outputPage.html", htmlString);

            return(htmlString);
        }
Esempio n. 2
0
        /// <summary>
        /// Quick hack Template gen function. need fix later...
        /// </summary>
        /// <param name="txtContent"></param>
        /// <param name="className"></param>
        /// <param name="memberName"></param>
        /// <param name="typeName"></param>
        /// <returns></returns>
        public string GenerateHTMLProperty2(string txtContent, string className, string memberName, string typeName)
        {
            string desc = GetDescriptionFromText(txtContent);

            var myData = new TemplateData_Base
            {
                m_class       = className,
                m_member      = memberName,
                m_type        = typeName,
                m_description = desc
            };

            var examples = CreateExamplesFromText(txtContent);

            myData.m_examples = examples;
            //if (examples.Count > 0)
            //{
            //    //myData.m_examples.AddRange(examples);
            //}

            var page = new PropertyTemplate(myData);

            return(page.TransformText());
        }
Esempio n. 3
0
 public SimpleHtml(TemplateData_Base data)
 {
     this.m_data = data;
 }
Esempio n. 4
0
 public PropertyTemplate(TemplateData_Base data)
 {
     this.m_data = data;
 }