示例#1
0
        //private void addToParameterProperties(PropertyInfo pi)
        //{
        //    var tcAttr = pi.CustomAttributes.FirstOrDefault(ca => ca.AttributeType == typeof(TypeCodeAttribute));
        //    if (tcAttr != null)
        //    {
        //        var arg = tcAttr.ConstructorArguments.FirstOrDefault(ca => ca.ArgumentType.BaseType == typeof(Enum));
        //        parametreProperties.Add(pi.Name, Enum.ToObject(arg.ArgumentType, arg.Value).ToString().ToUpper());
        //    }
        //}

        private void addToServiceProperties(PropertyInfo pi)
        {
            if (IsCollection(pi.PropertyType) || serviceProperties.Any(sp => sp.Name == pi.Name))
            {
                return;
            }
            string typeName = extractTypeName(pi);

            if (typeName == "Parametre" || pi.PropertyType.BaseType == typeof(Enum))
            {
                return;
            }
            Module module = searchTypeInModules(typeName);

            if (module != null)
            {
                serviceProperties.Add(pi);
            }
        }
示例#2
0
        private void addToListProperties(string typeName, string pName)
        {
            if (listProperties.ContainsKey(typeName))
            {
                return;
            }

            if (typeName == "Parametre")
            {
                listProperties.Add(pName, typeName);
            }
            else
            {
                Module module = searchTypeInModules(typeName);
                if (module != null)
                {
                    listProperties.Add(typeName, typeName);
                }
            }
        }
示例#3
0
        private void addToProviders(string typeName)
        {
            if (providers.Contains(typeName) || typeName == type.Name)
            {
                return;
            }

            if (typeName == "Parametre")
            {
                providers.Add(typeName);
            }
            else
            {
                Module module = searchTypeInModules(typeName);
                if (module != null)
                {
                    providers.Add(typeName);
                }
            }
        }
示例#4
0
        private void addToImports(string typeName)
        {
            if (imports.ContainsKey(typeName) || typeName == type.Name)
            {
                return;
            }

            if (typeName == "Parametre")
            {
                imports.Add(typeName, "import { Parametre } from \"app/yonetim/parametre/parametre\"");
            }
            else
            {
                Module module = searchTypeInModules(typeName);
                if (module != null)
                {
                    string lowTypeName = typeName.ToLower(new System.Globalization.CultureInfo("en-EN", false));
                    imports.Add(typeName, "import { " + typeName + " } from \"app/" + module.ModuleName + "/" + lowTypeName + "/" + lowTypeName + "\"");
                }
            }
        }
示例#5
0
 public EnumPipeTemplate(PropertyInfo pi, Module module)
 {
     Module = module;
     Pi     = pi;
 }