Ejemplo n.º 1
0
        private GenerateCodeTypeElementTreeNavigationItem CreateGenerateCodeTypeElementTreeNavigationItem(CompositeTypeElementTreeNavigationItem compositeTypeElementTreeNavigationItem)
        {
            GenerateCodeTypeElementTreeNavigationItem generateCodeTypeElementTreeNavigationItem = new GenerateCodeTypeElementTreeNavigationItem();

            generateCodeTypeElementTreeNavigationItem.CompositeTypeElementTreeNavigationItem = compositeTypeElementTreeNavigationItem;
            generateCodeTypeElementTreeNavigationItem.ColumnName = CreateColumnName(compositeTypeElementTreeNavigationItem.Name);
            generateCodeTypeElementTreeNavigationItem.Generate   = true;
            return(generateCodeTypeElementTreeNavigationItem);
        }
Ejemplo n.º 2
0
        private string GetDataType(GenerateCodeTypeElementTreeNavigationItem generatedCodeTypeElementTreeNavigationItem, Dictionary <string, Settings> codeDataTypeConversionToName)
        {
            string dataType        = "SymbolicReference";
            string elementTypeName = generatedCodeTypeElementTreeNavigationItem.CompositeTypeElementTreeNavigationItem.ElementTypeName;

            if (codeDataTypeConversionToName.ContainsKey(elementTypeName))
            {
                dataType = codeDataTypeConversionToName[elementTypeName].Value;
            }
            return(dataType);
        }
Ejemplo n.º 3
0
        private FieldStructure CreateFieldStructure(GenerateCodeTypeElementTreeNavigationItem generatedCodeTypeElementTreeNavigationItem, Dictionary <string, Settings> codeDataTypeConversionToName)
        {
            string dataType = GetDataType(generatedCodeTypeElementTreeNavigationItem, codeDataTypeConversionToName);

            FieldStructure fieldStructure = new FieldStructure(Modifier.PRIVATE, dataType, generatedCodeTypeElementTreeNavigationItem.CompositeTypeElementTreeNavigationItem.Name);

            if (generatedCodeTypeElementTreeNavigationItem.Id)
            {
                fieldStructure.AddAnnotation(Annotation.CreateAnnotation(Annotation.IdAnnotation));
            }
            if (generatedCodeTypeElementTreeNavigationItem.Transient)
            {
                fieldStructure.AddAnnotation(Annotation.CreateAnnotation(Annotation.TransientAnnotation));
            }
            if (!string.IsNullOrEmpty(generatedCodeTypeElementTreeNavigationItem.ColumnName))
            {
                fieldStructure.AddAnnotation(Annotation.CreateAnnotation(Annotation.ColumnAnnotation, generatedCodeTypeElementTreeNavigationItem.ColumnName));
            }
            return(fieldStructure);
        }