Example #1
0
        internal static AzureContext CreateFrom(Stream configStream, ContextSettings settings)
        {
            if (configStream == null)
                throw new ArgumentNullException("configStream");

            if (settings == null)
                throw new ArgumentNullException("settings");

            _config = configStream.ReadToEnd().FromJsonToObject<HostConfig>();
            _current = new AzureContext(_config, settings);
            return _current;
        }
Example #2
0
        internal static AzureContext CreateFrom(string configFilePath, ContextSettings settings)
        {
            if (string.IsNullOrEmpty(configFilePath))
                throw new ArgumentNullException("configFilePath");

            if (settings == null)
                throw new ArgumentNullException("settings");

            if (!File.Exists(configFilePath))
                throw new ConfigurationErrorsException("Could not find config file: " + configFilePath);

            _config = File.ReadAllText(configFilePath).FromJsonToObject<HostConfig>();
            _current = new AzureContext(_config, settings);
            return _current;
        }
Example #3
0
 internal static AzureContext CreateFrom(IHostConfig config, ContextSettings settings)
 {
     _config = config;
     _current = new AzureContext(_config, settings);
     return _current;
 }
Example #4
0
 internal static AzureContext CreateFrom(IHostConfig config, ContextSettings settings)
 {
     _config  = config;
     _current = new AzureContext(_config, settings);
     return(_current);
 }