Пример #1
0
 public NetConstructor(IReflector reflector, ConstructorInfo
                       constructor)
 {
     this.reflector   = reflector;
     this.constructor = constructor;
     Platform4.SetAccessible(constructor);
 }
Пример #2
0
        private static bool AreFieldsEqual(object a_compare, object a_with, string a_path
                                           , ArrayList a_list)
        {
            string path = GetPath(a_compare, a_with, a_path);

            FieldInfo[] fields = Sharpen.Runtime.GetDeclaredFields(a_compare.GetType());
            for (int i = 0; i < fields.Length; i++)
            {
                FieldInfo field = fields[i];
                if (Db4oUnitPlatform.IsUserField(field))
                {
                    Platform4.SetAccessible(field);
                    try
                    {
                        if (!IsFieldEqual(field, a_compare, a_with, path, a_list))
                        {
                            return(false);
                        }
                    }
                    catch (Exception e)
                    {
                        Sharpen.Runtime.Err.WriteLine("TCompare failure executing path:" + path);
                        Sharpen.Runtime.PrintStackTrace(e);
                        return(false);
                    }
                }
            }
            return(true);
        }
Пример #3
0
 /// <summary>public for implementation reasons, please ignore.</summary>
 /// <remarks>public for implementation reasons, please ignore.</remarks>
 public virtual bool AppliesTo(object candidate)
 {
     try
     {
         MethodInfo filterMethod = GetFilterMethod();
         Platform4.SetAccessible(filterMethod);
         object ret = filterMethod.Invoke(this, new object[] { candidate });
         return((bool)ret);
     }
     catch (Exception)
     {
         // TODO: log this exception somewhere?
         //			e.printStackTrace();
         return(false);
     }
 }