Beispiel #1
0
        private static void Configure(EnvironmentOptions options)
        {
            var settingsRepository = new SettingsRepository();

            CreatioEnvironment.EnvironmentName = options.Environment;
            CreatioEnvironment.Settings        = settingsRepository.GetEnvironment(options);
        }
Beispiel #2
0
        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));
        }
Beispiel #3
0
        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>());
        }
Beispiel #4
0
 public static void SetupAppConnection(EnvironmentOptions options)
 {
     Configure(options);
     CheckApiVersion();
 }
Beispiel #5
0
        private static EnvironmentSettings GetEnvironmentSettings(EnvironmentOptions options)
        {
            var settingsRepository = new SettingsRepository();

            return(settingsRepository.GetEnvironment(options));
        }