本文整理汇总了C#中ITypesInfo.FindTypeInfo方法的典型用法代码示例。如果您正苦于以下问题:C# ITypesInfo.FindTypeInfo方法的具体用法?C# ITypesInfo.FindTypeInfo怎么用?C# ITypesInfo.FindTypeInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITypesInfo
的用法示例。
在下文中一共展示了ITypesInfo.FindTypeInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CustomizeTypesInfo
public override void CustomizeTypesInfo(ITypesInfo typesInfo) {
base.CustomizeTypesInfo(typesInfo);
if (Application != null) {
typesInfo.FindTypeInfo(typeof(ShowInAnalysisPermission)).FindMember("ControllerType").AddAttribute(new VisibleInDetailViewAttribute(false));
typesInfo.FindTypeInfo(typeof(PivotSettingsPermission)).FindMember("ControllerType").AddAttribute(new VisibleInDetailViewAttribute(false));
}
}
示例2: StoreJob
public static IJobDetail StoreJob(this IScheduler scheduler, IXpandJobDetail xpandJobDetail,ITypesInfo typesInfo) {
var jobDetail = (JobDetailImpl)(scheduler.GetJobDetail(xpandJobDetail) ?? xpandJobDetail.CreateQuartzJobDetail());
jobDetail.AssignXpandJobDetail(xpandJobDetail);
var typeInfo = typesInfo.FindTypeInfo(xpandJobDetail.JobDataMap.GetType());
jobDetail.AssignDataMap(typeInfo, xpandJobDetail.JobDataMap);
if (xpandJobDetail.Job.DataMap != null) {
typeInfo = typesInfo.FindTypeInfo(xpandJobDetail.Job.DataMap.GetType());
jobDetail.AssignDataMap(typeInfo, xpandJobDetail.Job.DataMap);
}
scheduler.StoreJobCore(jobDetail);
return jobDetail;
}
示例3: CustomizeTypesInfo
public override void CustomizeTypesInfo(ITypesInfo typesInfo) {
base.CustomizeTypesInfo(typesInfo);
OnApplicationInitialized(Application);
var type = (BaseInfo)typesInfo.FindTypeInfo(typeof(IModelMember)).FindMember("Type");
var attribute = type.FindAttribute<ModelReadOnlyAttribute>();
if (attribute != null)
type.RemoveAttribute(attribute);
type = (BaseInfo)typesInfo.FindTypeInfo(typeof(IModelBOModelClassMembers));
attribute = type.FindAttribute<ModelReadOnlyAttribute>();
if (attribute != null)
type.RemoveAttribute(attribute);
}
示例4: CreateMembers
void CreateMembers(ITypesInfo typesInfo, Type optionsType, Type persistentType) {
ITypeInfo typeInfo = typesInfo.FindTypeInfo(ReflectionHelper.GetType(persistentType.Name));
IEnumerable<PropertyInfo> propertyInfos = optionsType.GetProperties().Where(info => info.GetSetMethod() != null).Where(propertyInfo => typeInfo.FindMember(propertyInfo.Name) == null);
foreach (PropertyInfo propertyInfo in propertyInfos) {
OnCreateMember(typeInfo, propertyInfo.Name, propertyInfo.PropertyType);
}
}
示例5: CreateMember
void CreateMember(ITypesInfo typesInfo, IRoleTypeProvider roleTypeProvider, SecurityOperationsAttribute attribute) {
var roleTypeInfo = typesInfo.FindTypeInfo(roleTypeProvider.RoleType);
if (roleTypeInfo.FindMember(attribute.OperationProviderProperty) == null) {
var memberInfo = roleTypeInfo.CreateMember(attribute.OperationProviderProperty, typeof(SecurityOperationsEnum));
memberInfo.AddAttribute(new RuleRequiredFieldAttribute());
}
}
示例6: UpdateLayoutManager
void UpdateLayoutManager(ITypesInfo typesInfo) {
if (!(LayoutManager is ILayoutManager)) {
var typeInfo = ReflectionHelper.FindTypeDescendants(typesInfo.FindTypeInfo(typeof(ILayoutManager))).FirstOrDefault();
if (typeInfo != null)
this.SetPropertyInfoBackingFieldValue(view => view.LayoutManager, this, ReflectionHelper.CreateObject(typeInfo.Type));
}
}
示例7: SetAdditionalExportedTypesProperties
private void SetAdditionalExportedTypesProperties(ITypesInfo typesInfo)
{
foreach (var type in AdditionalExportedTypes)
{
var typeInfo = (TypeInfo)typesInfo.FindTypeInfo(type);
typeInfo.IsDomainComponent = true;
}
}
示例8: Init
public void Init()
{
_TypesInfo = A.Fake<ITypesInfo>();
_TypeInfo = A.Fake<ITypeInfo>();
A.CallTo(() => _TypesInfo.FindTypeInfo(A<Type>.Ignored)).Returns(_TypeInfo);
_Builder = ModelBuilder.Create<TargetClass>(_TypesInfo);
}
示例9: AddNewObjectCreateGroup
void AddNewObjectCreateGroup(ITypesInfo typesInfo, IEnumerable<Type> types) {
foreach (var type in types) {
var typeDescendants = ReflectionHelper.FindTypeDescendants(typesInfo.FindTypeInfo(type));
foreach (var typeInfo in typeDescendants) {
typeInfo.AddAttribute(new NewObjectCreateGroupAttribute("Logic"));
}
}
}
示例10: CustomizeTypesInfo
public override void CustomizeTypesInfo(ITypesInfo typesInfo) {
if (Debugger.IsAttached) {
IEnumerable<XPClassInfo> collection = XafTypesInfo.XpoTypeInfoSource.XPDictionary.Classes.Cast<XPClassInfo>();
foreach (var typeInfo in collection)
if (typeInfo.HasAttribute(typeof(RuleCombinationOfPropertiesIsUniqueAttribute)))
if (typesInfo.FindTypeInfo(typeInfo.ClassType).DefaultMember == null)
throw new NullReferenceException("DefaultMember of " + typeInfo.FullName + " is null");
}
}
示例11: CustomizeTypesInfo
public override void CustomizeTypesInfo(ITypesInfo typesInfo) {
base.CustomizeTypesInfo(typesInfo);
if (Application == null)
return;
typesInfo.FindTypeInfo(TypesInfo.AnalysisType).AddAttribute(new DefaultPropertyAttribute("Name"));
foreach (var keyValuePair in GetOptionsMapperDictionary()) {
CreateMembers(typesInfo, keyValuePair.Key, keyValuePair.Value);
}
}
示例12: CustomizeTypesInfo
public override void CustomizeTypesInfo(ITypesInfo typesInfo) {
base.CustomizeTypesInfo(typesInfo);
var typeInfo = typesInfo.FindTypeInfo<XpoStateMachine>();
typeInfo.CreateMember(EnableFilteredPropety, typeof (bool));
if (!RuntimeMode) {
CreateDesignTimeCollection(typesInfo, typeof(XpoStateMachine), AdminRoles);
} else if (Application.CanBuildSecurityObjects()) {
BuildSecuritySystemObjects();
}
}
示例13: HandleCustomAttribute
void HandleCustomAttribute(IMemberInfo memberInfo, ITypesInfo typesInfo) {
var customAttributes = memberInfo.FindAttributes<Attribute>().OfType<ICustomAttribute>().ToList();
foreach (var customAttribute in customAttributes) {
for (int index = 0; index < customAttribute.Name.Split(';').Length; index++) {
string s = customAttribute.Name.Split(';')[index];
var theValue = customAttribute.Value.Split(';')[index];
var typeInfo = typesInfo.FindTypeInfo(theValue);
if (customAttribute is PropertyEditorAttribute && typeInfo.IsInterface) {
try {
theValue = typeInfo.Implementors.Single().FullName;
} catch (InvalidOperationException) {
if (Application != null)
throw new InvalidOperationException(typeInfo.FullName + " has no implementors");
}
}
memberInfo.AddAttribute(new ModelDefaultAttribute(s, theValue));
}
}
}
示例14: ModifySequenceObjectWhenMySqlDatalayer
void ModifySequenceObjectWhenMySqlDatalayer(ITypesInfo typesInfo) {
var typeInfo = typesInfo.FindTypeInfo(SequenceObjectType);
if (IsMySql(typeInfo)) {
var memberInfo = (XafMemberInfo)typeInfo.FindMember<ISequenceObject>(o => o.TypeName);
memberInfo.RemoveAttributes<SizeAttribute>();
memberInfo.AddAttribute(new SizeAttribute(255));
}
}
示例15: CustomizeTypesInfo
public override void CustomizeTypesInfo(ITypesInfo typesInfo)
{
base.CustomizeTypesInfo(typesInfo);
ITypeInfo info = typesInfo.FindTypeInfo(typeof(PersistentBase));
if (FilterProviderManager.Providers != null)
foreach (FilterProviderBase provider in FilterProviderManager.Providers)
{
if (info.FindMember(provider.FilterMemberName) == null)
CreateMember(info, provider);
}
}