-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
42 lines (36 loc) · 1.27 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
namespace Rackspace.Quickstart
{
internal class Program
{
private static Dictionary<int, IExampleTest> _tests = new Dictionary<int, IExampleTest>
{
{1, new CDN.Test()}
};
private static void Main()
{
Console.Write("Enter your Rackspace username: ");
string username = Console.ReadLine();
Console.Write("Enter your Rackspace API Key: ");
string apikey = Console.ReadLine();
Console.WriteLine();
Console.WriteLine("Available Examples: ");
Console.WriteLine("\t1. Content Delivery Network (CDN)");
Console.WriteLine();
Console.Write("Enter the example number to execute: ");
string requestedExample = Console.ReadLine();
int exampleId;
if (!(int.TryParse(requestedExample, out exampleId) && _tests.ContainsKey(exampleId)))
{
Console.WriteLine("Invalid example requested. Exiting.");
}
else
{
_tests[exampleId].Run(username, apikey).Wait();
}
Console.Write("Press any key to exit...");
Console.ReadLine();
}
}
}