예제 #1
0
        public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
        {
            DataStructureInfo info         = (DataStructureInfo)conceptInfo;
            string            propertyName = CaptionHelper.GetCaptionConstant(info);
            string            caption      = CaptionHelper.GetCaption(info.Name);

            string generiraniKod =
                @"  
              <data name=""" + propertyName + @""" xml:space=""preserve"">
                <value>" + caption + @"</value>
              </data>";

            if (!GeneriraneKonstante.Contains(propertyName))
            {
                GeneriraneKonstante.Add(propertyName);


                codeBuilder.InsertCode(generiraniKod, MvcModelGeneratorTags.ModuleMembers);
            }
        }
예제 #2
0
        public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
        {
            PropertyInfo info         = (PropertyInfo)conceptInfo;
            string       propertyName = CaptionHelper.GetCaptionConstant(info);
            string       caption      = CaptionHelper.GetCaption(info.Name);

            string generiraniKod =
                @"  
              <data name=""" + propertyName + @""" xml:space=""preserve"">
                <value>" + caption + @"</value>
              </data>";

            if (!GeneriraneKonstante.Contains(propertyName))
            {
                GeneriraneKonstante.Add(propertyName);

                string propertyType = GetPropertyType(info);
                if (!String.IsNullOrEmpty(propertyType) && DataStructureCodeGenerator.IsTypeSupported(info.DataStructure))
                {
                    codeBuilder.InsertCode(generiraniKod, MvcModelGeneratorTags.ModuleMembers);
                }
            }
        }