Exemplo n.º 1
0
        private static UtilConfigurationManager Configure(TfsUtilsConfigurationSection config)
        {
            var commandList = config.CommandsSection.Commands.ToList();

            var r = from cmd in commandList
                    let commandName = !string.IsNullOrWhiteSpace(cmd.Alias) ? cmd.Alias : cmd.Type.Name
                                      select new
            {
                CommandName  = commandName,
                CommandType  = cmd.Type,
                CommandProps = DynamicMapper.MapTo(cmd.PropertiesSection.PropertySettings, cmd.PropertiesSection.Type)
            };

            return(new UtilConfigurationManager
            {
                ServerUri = new Uri(config.CommandsSection.ServerUri),
                Commands =
                    r.ToDictionary(kvp => kvp.CommandName,
                                   kvp => Tuple.Create(kvp.CommandType, kvp.CommandProps),
                                   StringComparer.InvariantCultureIgnoreCase)
            });
        }
Exemplo n.º 2
0
 public T GetConfigurationProperty <T>()
 {
     return(DynamicMapper.MapTo <T>(PropertySettings));
 }