Ejemplo n.º 1
0
        private static string GetProperty(string propertyName)
        {
            string defaultValue = "";
            int    i            = propertyName.LastIndexOf("??", System.StringComparison.Ordinal);

            if (i >= 0)
            {
                defaultValue = propertyName.Substring(i + 2);
                propertyName = propertyName.Substring(0, i);
            }
            i = propertyName.IndexOf('/');
            if (i >= 0)
            {
                Properties properties = PropertyService.Get <Properties>(propertyName.Substring(0, i), new Properties());
                propertyName = propertyName.Substring(i + 1);
                i            = propertyName.IndexOf('/');
                while (i >= 0)
                {
                    properties   = properties.Get <Properties>(propertyName.Substring(0, i), new Properties());
                    propertyName = propertyName.Substring(i + 1);
                }
                return(properties.Get <string>(propertyName, defaultValue));
            }
            return(PropertyService.Get <string>(propertyName, defaultValue));
        }
Ejemplo n.º 2
0
        public Dog Generate <A>() where A : Dog
        {
            var factory = dicts.Get <IDogFactoryType <A> >(typeof(A).Name);

            return(factory.Generate());
        }