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