private static void Configure(EnvironmentOptions options) { var settingsRepository = new SettingsRepository(); CreatioEnvironment.EnvironmentName = options.Environment; CreatioEnvironment.Settings = settingsRepository.GetEnvironment(options); }
private static TCommand CreateRemoteCommand <TCommand>(EnvironmentOptions options, params object[] additionalConstructorArgs) { var settings = GetEnvironmentSettings(options); var creatioClient = new CreatioClient(settings.Uri, settings.Login, settings.Password, true, settings.IsNetCore); var clientAdapter = new CreatioClientAdapter(creatioClient); var constructorArgs = new object[] { clientAdapter, settings }.Concat(additionalConstructorArgs).ToArray(); return((TCommand)Activator.CreateInstance(typeof(TCommand), constructorArgs)); }
private static T Resolve <T>(EnvironmentOptions options = null) { EnvironmentSettings settings = null; if (options != null) { settings = GetEnvironmentSettings(options); } var container = new BindingsModule().Register(settings); return(container.Resolve <T>()); }
public static void SetupAppConnection(EnvironmentOptions options) { Configure(options); CheckApiVersion(); }
private static EnvironmentSettings GetEnvironmentSettings(EnvironmentOptions options) { var settingsRepository = new SettingsRepository(); return(settingsRepository.GetEnvironment(options)); }