public static CruiseControlConfiguration Parse(XElement element)
        {
            if (element == null)
                return null;

            var configuration = new CruiseControlConfiguration();

            var url = element.Attribute("url");
            if (url != null)
                configuration.InstallDirectoryUrl = url.Value;

            var interval = element.Attribute("interval");
            if (interval != null)
                configuration.CheckInterval = int.Parse(interval.Value);

            var username = element.Attribute("username");
            if (username != null)
                configuration.Username = username.Value;

            var password = element.Attribute("password");
            if (password != null)
                configuration.Password = password.Value;

            var domain = element.Attribute("domain");
            if (domain != null)
                configuration.Domain = domain.Value;

            return configuration;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CruiseControlBuildNotificationSystem"/> class using the Cruise Control Configuration provided
        /// </summary>
        /// <param name="configuration">
        /// Cruise Control Configuration Implementation
        /// </param>
        public CruiseControlBuildNotificationSystem(CruiseControlConfiguration configuration)
        {
            _cruiseControlInstallUrl = configuration.InstallDirectoryUrl;
            _numSecondsToCheck = configuration.CheckInterval ?? 90;

            _currentProjects = new List<CruiseControlProject>();
            var credentials = !string.IsNullOrWhiteSpace(configuration.Username) ? new NetworkCredential(configuration.Username, configuration.Password, configuration.Domain) : null;
            _webClient = new WebClient { Credentials = credentials, CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore) };
            _webClient.DownloadDataCompleted += Data_Downloaded;
        }