Example #1
0
 /// <summary>
 /// Provides a global access point for the single instance of the <see cref="UrlDataProvider"/>
 /// class.
 /// </summary>
 /// <returns>A reference to the single instance of <see cref="UrlDataProvider"/>.</returns>
 public static UrlDataProvider Instance()
 {
     if (instance == null)
     {
         //Make sure the call is thread-safe.
         Mutex mutex = new Mutex();
         mutex.WaitOne();
         if (instance == null)
         {
             instance = new UrlDataProvider();
         }
         mutex.Close();
     }
     return(instance);
 }
Example #2
0
 /// <summary>
 /// Provides a global access point for the single instance of the <see cref="UrlDataProvider"/>
 /// class.
 /// </summary>
 /// <returns>A reference to the single instance of <see cref="UrlDataProvider"/>.</returns>
 public static UrlDataProvider Instance()
 {
     if (instance==null)
     {
         //Make sure the call is thread-safe.
         Mutex mutex=new Mutex();
         mutex.WaitOne();
         if( instance == null )
         {
             instance = new UrlDataProvider();
         }
         mutex.Close();
     }
     return instance;
 }