Changeset 953


Ignore:
Timestamp:
5/1/2009 4:57:42 AM (5 years ago)
Author:
lowjoel
Message:

Enforce the fact that only one ManagerLibrary? instance can exist at any one time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Manager/Manager.cs

    r947 r953  
    3535        public ManagerLibrary(SettingsManager settings) 
    3636        { 
     37            if (Instance != null) 
     38                throw new InvalidOperationException("Only one ManagerLibrary instance can " + 
     39                    "exist at any one time"); 
     40 
    3741            Instance = this; 
    3842            SettingsManager = settings; 
     
    5963            } 
    6064 
     65            SettingsManager = null; 
    6166            Instance = null; 
    6267        } 
     
    7176        /// The global library instance. 
    7277        /// </summary> 
    73         public static ManagerLibrary Instance; 
     78        public static ManagerLibrary Instance { get; private set; } 
    7479 
    7580        /// <summary> 
Note: See TracChangeset for help on using the changeset viewer.