private IList<Actions.Action> BuildActionsForWatcher(StatusWatcher watcher, WatcherSection configWatcher)
        {
            var result = new List<Actions.Action>();
            IList<object> listOfParameters;
            IList<PropertyInfo> properties;

            for (int j = 0; j < configWatcher.ContingenceActions.Count; j++)
            {
                var contingenceActionFromConfig = configWatcher.ContingenceActions[j];

                var type = Type.GetType(contingenceActionFromConfig.Type);
                var constructorInformation = type.GetConstructors().FirstOrDefault();

                listOfParameters = new List<object>();
                listOfParameters.Add(watcher);

                properties = contingenceActionFromConfig.GetType().GetProperties();
                foreach (var parameter in constructorInformation.GetParameters())
                {
                    if (parameter.Name.ToLower() != "statuswatcher")
                        listOfParameters.Add(
                            Convert.ChangeType(
                            properties.FirstOrDefault(x => x.Name.ToLower() == parameter.Name.ToLower()).GetValue(contingenceActionFromConfig),
                            parameter.ParameterType,
                            CultureInfo.InvariantCulture)
                            );
                }

                Actions.Action action = Activator.CreateInstance(type, listOfParameters.ToArray()) as Actions.Action;
                result.Add(action);
            }
            return result;
        }
        private StatusWatcher BuildWatcherFromConfiguration(WatcherSection configWatcher)
        {
            var type = Type.GetType(configWatcher.Type);
            ConstructorInfo constructorInformation = type.GetConstructors().FirstOrDefault();

            var listOfParameters = new List<object>();
            var properties = configWatcher.GetType().GetProperties();
            foreach (var parameter in constructorInformation.GetParameters())
            {
                listOfParameters.Add(
                    Convert.ChangeType(
                    properties.FirstOrDefault(x => x.Name.ToLower() == parameter.Name.ToLower()).GetValue(configWatcher),
                    parameter.ParameterType,
                    CultureInfo.InvariantCulture)
                    );
            }
            return Activator.CreateInstance(type, listOfParameters.ToArray()) as StatusWatcher;
        }