Changeset 1987 for trunk/eraser


Ignore:
Timestamp:
4/28/2010 9:20:46 AM (5 years ago)
Author:
lowjoel
Message:

Conversion fixes so that the import process will be error-free.

Location:
trunk/eraser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser.Manager/Settings.cs

    r1984 r1987  
    495495                Settings = settings; 
    496496                SettingName = settingName; 
    497                 List = settings.GetValue<List<T>>(settingName); 
     497                List = new List<T>(settings.GetValue<T[]>(settingName)); 
    498498                if (List == null) 
    499499                    List = new List<T>(); 
  • trunk/eraser/Eraser/Settings.cs

    r1985 r1987  
    2424using System.Windows.Forms; 
    2525using System.Text; 
     26using System.Linq; 
    2627 
    2728using System.IO; 
     
    8586                //Get the raw registry value 
    8687                object rawResult = Key.GetValue(name, null); 
     88                if (rawResult == null) 
     89                    return defaultValue; 
    8790 
    8891                //Check if it is a serialised object 
     
    112115                { 
    113116                    return (T)(object)new Guid((string)rawResult); 
     117                } 
     118                else if (typeof(T).GetInterfaces().Any(x => x == typeof(IConvertible))) 
     119                { 
     120                    return (T)Convert.ChangeType(rawResult, typeof(T)); 
    114121                } 
    115122                else 
Note: See TracChangeset for help on using the changeset viewer.