public void CheckConnection(VersionOneSettings settings) {
	        if (settings.OAuth2)
	        {
		        return;
	        }
	        else
	        {
		        var connectionValidator = new V1ConnectionValidator(settings.Path, settings.Username, settings.Password,
		                                                            settings.Integrated, GetProxy(settings.ProxySettings));
		        connectionValidator.Test(ApiVersion);
	        }
        }
        private static VersionOneSettings CreateVersionOneSettings(ISettings settings) {
            var versionOneSettings = new VersionOneSettings {
                Path = settings.ApplicationUrl,
                Username = settings.Username,
                Password = settings.Password,
                Integrated = settings.IntegratedAuth,
                ProxySettings = {
                    UseProxy = settings.UseProxy,
                    Url = settings.ProxyUrl,
                    Domain = settings.ProxyDomain,
                    Username = settings.ProxyUsername,
                    Password = settings.ProxyPassword
                }
            };

            return versionOneSettings;
        }
        public void Connect(VersionOneSettings settings) {
            var path = settings.Path;
            var username = settings.Username;
            var password = settings.Password;
            var integrated = settings.Integrated;
            var proxy = GetProxy(settings.ProxySettings);
            VersionOneSettings = settings;

            var metaConnector = new V1APIConnector(path + MetaUrlSuffix, username, password, integrated, proxy);
            MetaModel = new MetaModel(metaConnector);

            var localizerConnector = new V1APIConnector(path + LocalizerUrlSuffix, username, password, integrated, proxy);
            Localizer = new Localizer(localizerConnector);

            var dataConnector = new V1APIConnector(path + DataUrlSuffix, username, password, integrated, proxy);
            Services = new Services(MetaModel, dataConnector);

            V1Configuration = LoadV1Configuration();
        }
		public void Connect(VersionOneSettings settings)
		{
			var path = settings.Path;
			var username = settings.Username;
			var password = settings.Password;
			var integrated = settings.Integrated;
			var proxy = GetProxy(settings.ProxySettings);
			VersionOneSettings = settings;

			if (VersionOneSettings.OAuth2)
			{
				var storage = OAuth2Client.Storage.JsonFileStorage.Default;
				var metaConnector = new V1OAuth2APIConnector(path + MetaUrlSuffix, storage, proxy);
				MetaModel = new MetaModel(metaConnector);

				var localizerConnector = new V1OAuth2APIConnector(path + LocalizerUrlSuffix, storage, proxy);
				Localizer = new Localizer(localizerConnector);

				var dataConnector = new V1OAuth2APIConnector(path + DataUrlSuffix, storage, proxy);
				Services = new Services(MetaModel, dataConnector);

			}
			else
			{
				var metaConnector = new V1APIConnector(path + MetaUrlSuffix, username, password, integrated, proxy);
				MetaModel = new MetaModel(metaConnector);

				var localizerConnector = new V1APIConnector(path + LocalizerUrlSuffix, username, password, integrated, proxy);
				Localizer = new Localizer(localizerConnector);

				var dataConnector = new V1APIConnector(path + DataUrlSuffix, username, password, integrated, proxy);
				Services = new Services(MetaModel, dataConnector);
				
			}
			V1Configuration = LoadV1Configuration();
		}
        public bool Connect(VersionOneSettings settings) {
            connector.IsConnected = false;

            try {
                connector.Connect(settings);

                Types = new Dictionary<string, IAssetType>(5);
                ProjectType = GetAssetType(Entity.ProjectType);
                TaskType = GetAssetType(Entity.TaskType);
                TestType = GetAssetType(Entity.TestType);
                DefectType = GetAssetType(Entity.DefectType);
                StoryType = GetAssetType(Entity.StoryType);
                workitemType = connector.MetaModel.GetAssetType("Workitem");
                primaryWorkitemType = connector.MetaModel.GetAssetType("PrimaryWorkitem");

                InitEffortTracking();

                MemberOid = connector.Services.LoggedIn;
                listPropertyValues = GetListPropertyValues();
                requiredFieldsValidator = new RequiredFieldsValidator(connector.MetaModel, connector.Services, this);
                connector.IsConnected = true;

                return true;
            } catch(MetaException ex) {
                Logger.Error("Cannot connect to V1 server.", ex);
                return false;
            } catch(WebException ex) {
                connector.IsConnected = false;
                Logger.Error("Cannot connect to V1 server.", ex);
                return false;
            } catch(Exception ex) {
                Logger.Error("Cannot connect to V1 server.", ex);
                return false;
            }
        }
 public void CheckConnection(VersionOneSettings settings) {
     try {
         connector.CheckConnection(settings);
     } catch(Exception ex) {
         logger.Error("Cannot connect to V1 server.", ex);
         throw new DataLayerException("Cannot connect to VersionOne server.", ex);
     }
 }