Exemplo n.º 1
0
 /// <summary>
 /// Deserializes all of the <see cref="T:ProfileGroup"/> files found in the app_data/Profiles/ and puts them into a <see cref="T:ProfileGroups"/>.
 /// </summary>
 /// <returns>a new instance of <see cref="T:ProfileGroups"/></returns>
 public static ProfileGroups LoadFromFile()
 {
     lock (_cacheLock)
     {
         if (_cachedProfileGroups == null)
         {
             _cachedProfileGroups = new ProfileGroups();
             string[] files = Directory.GetFiles(PathMapper.ConfigProfiles(""));
             foreach (string profileFileName in files)
             {
                 _cachedProfileGroups.Items.Add(ProfileGroup.LoadFromFile(profileFileName));
             }
         }
     }
     return(_cachedProfileGroups);
 }