public static void Initialize()
        {
            var homeDir = Environment.ExpandEnvironmentVariables("C:\\");

            var path = Path.Combine(homeDir, ".openstack_net");

            var contents = new StringBuilder();

            using(var stream = File.Open(path, FileMode.Open, FileAccess.Read))
            {
                using(var reader = new StreamReader(stream))
                {
                    while (!reader.EndOfStream)
                    {
                        var line = reader.ReadLine();
                        if(!line.Trim().StartsWith("//"))
                            contents.Append(line);
                    }
                }
            }

            var appCredentials = Newtonsoft.Json.JsonConvert.DeserializeObject<OpenstackNetSetings>(contents.ToString());

            _settings = appCredentials;
        }
Example #2
0
        public static void Initialize()
        {
            var homeDir = Environment.ExpandEnvironmentVariables("C:\\");

            var path = Path.Combine(homeDir, ".openstack_net");

            var contents = new StringBuilder();

            using (var stream = File.Open(path, FileMode.Open, FileAccess.Read))
            {
                using (var reader = new StreamReader(stream))
                {
                    while (!reader.EndOfStream)
                    {
                        var line = reader.ReadLine();
                        if (!line.Trim().StartsWith("//"))
                        {
                            contents.Append(line);
                        }
                    }
                }
            }

            var appCredentials = Newtonsoft.Json.JsonConvert.DeserializeObject <OpenstackNetSetings>(contents.ToString());

            _settings = appCredentials;
        }