增加Prism 框架
This commit is contained in:
1 parent
2cd6b8db86
commit
726eb6de16
99 files changed
+12527
No files matched your search
@@ -0,0 +1,23 @@
|
||||
using Autofac.Core;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace MAX.Core.Autofac
|
||||
{
|
||||
/// <summary>
|
||||
/// autofac 找出所有属性上是否摸个特性
|
||||
/// </summary>
|
||||
public class CustomPropertySelector : IPropertySelector
|
||||
{
|
||||
public bool InjectProperty(PropertyInfo propertyInfo, object instance)
|
||||
{
|
||||
if (propertyInfo.CustomAttributes.Any(iterator => iterator.AttributeType == typeof(AutowiredAttribute)))
|
||||
{
|
||||
|
||||
}
|
||||
//需要一个判断
|
||||
//;如果标记的有CustomPropertyAttribute特性返回True:返回true;就构造实例
|
||||
return propertyInfo.CustomAttributes.Any(iterator => iterator.AttributeType == typeof(AutowiredAttribute));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user