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

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

            return(settingsRepository.GetEnvironment(options));
        }