示例#1
0
文件: Native.cs 项目: hombrevrc/FDK
        static Assembly OnAssemblyResolve(object sender, ResolveEventArgs args)
        {
            var length = args.Name.IndexOf(',');

            if (length < 0)
            {
                return(null);
            }

            TraceUtils.WriteLine("Resolving: '{0}'", args.Name);

            var name   = args.Name.Substring(0, length);
            var result = ManagedLibrary.ModulesManager.LoadAssembly(name);

            if (result == null)
            {
                return(null);
            }

            if (result.FullName != args.Name)
            {
                return(null);
            }

            return(result);
        }
示例#2
0
        public static ComparePair <TModel, TObj> ShouldBeEqual <TModel, TObj>(
            this ComparePair <TModel, TObj> pair,
            TraceUtils trace,
            Expression <Func <TModel, int> > modelPropExp,
            Expression <Func <TObj, int> > objPropLExp)
        {
            var modelProp = pair.Model.GetExpressionValue <TModel, int>(modelPropExp);
            var objProp   = pair.Object.GetExpressionValue <TObj, int>(objPropLExp);

            trace.WriteLine(string.Format("Model prop [{0}] on obj prop [{1}]: model:[{2}] obj:[{3}]",
                                          modelProp.Name,
                                          objProp.Name,
                                          modelProp.Value,
                                          objProp.Value));

            Assert.AreEqual(modelProp.Value, objProp.Value);

            return(pair);
        }