public YouTrackService(IYouTrackExtensionConfigFacade pConfig)
 {
     _config       = pConfig;
     _ytConnection = getServiceConnection((YouTrackExtensionConfigFacade)pConfig);
     _ytIssues     = _ytConnection.CreateIssuesService();
     _log.Debug("YouTrackService: ctor called");
 }
 public YouTrackExtension(IYouTrackExtensionConfigFacade pConfig)
 {
     try
     {
         _config    = pConfig;
         _ytService = new YouTrackService(pConfig);
     }
     catch (Exception ex)
     {
         _log.ErrorFormat("YouTrackExtension: {0}\n\t{1}", ex.Message, ex.StackTrace);
     }
 }
        private static void validateConfig(IYouTrackExtensionConfigFacade pConfig)
        {
            if (pConfig.HostUri.Host.Equals("issues.domain.com", StringComparison.InvariantCultureIgnoreCase))
            {
                return;
            }

            /*//validate URL
             * var testConnection = new Connection(pConfig.HostUri.DnsSafeHost, pConfig.HostUri.Port, pConfig.UseSsl);
             * testConnection.Head("/rest/user/login");*/

            if (pConfig.HostUri == null)
            {
                throw new ApplicationException(string.Format("YouTrack setting '{0}' cannot be null or empty!", ConfigParameterNames.HostUri));
            }

            throwErrorIfRequiredStringSettingIsMissing(pConfig.BranchPrefix, ConfigParameterNames.BranchPrefix);
            throwErrorIfRequiredStringSettingIsMissing(pConfig.UserId, ConfigParameterNames.UserId);
            throwErrorIfRequiredStringSettingIsMissing(pConfig.Password, ConfigParameterNames.Password);
        }