示例#1
0
 public static CloudFoundryCreateUserProvidedServiceSettings SetCredentials(
     this CloudFoundryCreateUserProvidedServiceSettings toolSettings,
     Dictionary <string, string> credentials)
 {
     toolSettings             = toolSettings.NewInstance();
     toolSettings.Credentials = JObject.FromObject(credentials);
     return(toolSettings);
 }
示例#2
0
 public static CloudFoundryCreateUserProvidedServiceSettings SetCredentials(
     this CloudFoundryCreateUserProvidedServiceSettings toolSettings,
     string key,
     string value)
 {
     // credentials are often simple key value pairs but don't have to be,
     // they can be a more complex data structure, so core value is JObject.
     toolSettings = toolSettings.NewInstance();
     toolSettings.Credentials.SetKeyValue(key, value);
     return(toolSettings);
 }
示例#3
0
        public static CloudFoundryCreateUserProvidedServiceSettings SetCredentials(
            this CloudFoundryCreateUserProvidedServiceSettings toolSettings,
            string credentialsFile)
        {
            toolSettings = toolSettings.NewInstance();

            using (var file = File.OpenText(credentialsFile))
                using (var reader = new JsonTextReader(file))
                {
                    toolSettings.Credentials = (JObject)JToken.ReadFrom(reader);
                }

            return(toolSettings);
        }