예제 #1
0
 /// <summary>
 /// Runs a code sample.
 /// </summary>
 /// <param name="user">The user whose credentials should be used for
 /// running the sample.</param>
 /// <param name="sample">The code sample to run.</param>
 private static void RunASample(DfaUser user, SampleBase sample)
 {
     try {
         Console.WriteLine(sample.Description);
         sample.Run(user);
     } catch (Exception ex) {
         Console.WriteLine("An exception occurred while running this code example.\n{0} at\n{1}",
                           ex.Message, ex.StackTrace);
     } finally {
         Console.WriteLine("Press [Enter] to continue");
         Console.ReadLine();
     }
 }
예제 #2
0
 static void RegisterSample(string key, SampleBase value)
 {
     sampleMap.Add(new SamplePair(key, value));
 }
예제 #3
0
 /// <summary>
 /// Runs a code sample.
 /// </summary>
 /// <param name="user">The user whose credentials should be used for
 /// running the sample.</param>
 /// <param name="sample">The code sample to run.</param>
 private static void RunASample(DfaUser user, SampleBase sample) {
   try {
     Console.WriteLine(sample.Description);
     sample.Run(user);
   } catch (Exception ex) {
     Console.WriteLine("An exception occurred while running this code example.\n{0} at\n{1}",
         ex.Message, ex.StackTrace);
   } finally {
     Console.WriteLine("Press [Enter] to continue");
     Console.ReadLine();
   }
 }
예제 #4
0
 static void RegisterSample(string key, SampleBase value) {
   sampleMap.Add(new SamplePair(key, value));
 }