public SilverException(SilverInstance obj)
        {
            SilverClass klass = obj.Class;

            bool exceptionFound = false;
            SilverClass _class = obj.Class;
            do {
                if (_class.Name.Equals("Exception")) {
                    exceptionFound = true;
                    break;
                }
                _class = _class.Parent;
            } while (!exceptionFound && _class != null);

            if (exceptionFound) {
                ExceptionClass = klass;
                InnerObject = obj;
            }
            else {
                ExceptionClass = Silver.Box(typeof (SilverException));
                InnerObject = null;
            }
        }
 private static bool HasParent(SilverInstance silverObject, Type type)
 {
     SilverClass @class = silverObject.Class;
     do {
         if (@class is SilverBoxedClass && ((SilverBoxedClass) @class).BoxedType == type) {
             return true;
         }
     } while ((@class = @class.Parent) != null);
     return false;
 }
 // .net -> silver
 internal static void SyncInstanceVariablesTo(SilverInstance silverObject, object obj)
 {
     List<FieldInfo> _fields =
         obj.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).ToList();
     _fields.ForEach(field => silverObject.InstanceVariables[field.Name] = field.GetValue(obj));
 }
 // silver -> .net
 internal static void SyncInstanceVariablesFrom(SilverInstance silverObject, object obj)
 {
     List<FieldInfo> _fields =
         obj.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).ToList();
     silverObject.InstanceVariables.Variables.Keys.ToList().ForEach(key => {
         IEnumerable<FieldInfo> _fq = _fields.Where(field => field.Name == key);
         if (_fq.Any())
         {
             dynamic val = silverObject.InstanceVariables[key];
             if (val is SilverNumber)
             {
                 val = SilverNumber.Convert(val);
             }
             _fq.First().SetValue(obj, val);
         }
     });
 }