本文整理汇总了C#中ITypeInfo.FindMember方法的典型用法代码示例。如果您正苦于以下问题:C# ITypeInfo.FindMember方法的具体用法?C# ITypeInfo.FindMember怎么用?C# ITypeInfo.FindMember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITypeInfo
的用法示例。
在下文中一共展示了ITypeInfo.FindMember方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: removeUnlimitedSizeMembers
private ICollection<string> removeUnlimitedSizeMembers(IEnumerable<string> properties, ITypeInfo typeInfo)
{
return (from property in properties
let attribute = typeInfo.FindMember(property).FindAttribute<SizeAttribute>()
where (attribute != null && attribute.Size != SizeAttribute.Unlimited) || attribute == null
select property).ToList();
}
示例2: AddRoles
void AddRoles(IModelRegistration modelRegistration, ITypeInfo userTypeInfo, ISecurityUserWithRoles securityUserWithRoles,
IObjectSpace objectSpace) {
var roles = (XPBaseCollection) userTypeInfo.FindMember("Roles").GetValue(securityUserWithRoles);
var roleType = modelRegistration.RoleModelClass.TypeInfo.Type;
var criteria = CriteriaOperator.Parse(modelRegistration.RoleCriteria);
var objects = objectSpace.GetObjects(roleType, criteria);
roles.BaseAddRange(objects);
}
示例3: UpdateVersionInXaml
void UpdateVersionInXaml(ITypeInfo objectsTypeInfo, Version oldVersion, Version newVersion) {
if (objectsTypeInfo != null && objectsTypeInfo.IsPersistent) {
IMemberInfo xamlMemberInfo = objectsTypeInfo.FindMember(XamlPropertyName);
if (xamlMemberInfo == null) {
throw new MemberNotFoundException(objectsTypeInfo.Type, XamlPropertyName);
}
foreach (object objectToUpdate in ObjectSpace.GetObjects(objectsTypeInfo.Type)) {
var currentXaml = xamlMemberInfo.GetValue(objectToUpdate) as string;
string updatedXaml = WorkflowDefinitionsUpdater.UpdateDxAssembliesVersions(currentXaml, oldVersion, newVersion);
xamlMemberInfo.SetValue(objectToUpdate, updatedXaml);
ObjectSpace.SetModified(objectToUpdate);
}
if (ObjectSpace.IsModified) {
ObjectSpace.CommitChanges();
}
}
}
示例4: CreateDefaultFilterControlRepositoryItem
public static RepositoryItem CreateDefaultFilterControlRepositoryItem(this DataColumnInfoFilterColumn column, DevExpress.XtraGrid.Views.Grid.GridView gridView, ITypeInfo objectTypeInfo, RepositoryEditorsFactory repositoryFactory) {
if (gridView != null && column != null) {
if (column.Parent == null || !column.Parent.IsList) {
IMemberInfo memberInfo = objectTypeInfo.FindMember(column.FullName);
if (memberInfo != null) {
GridColumn gridColumn = gridView.Columns[memberInfo.BindingName];
if (gridColumn != null) {
return new GridFilterColumn(gridColumn).ColumnEditor;
}
}
}
if (repositoryFactory != null && column.ColumnType != null) {
return repositoryFactory.CreateStandaloneRepositoryItem(column.ColumnType);
}
}
return null;
}
示例5: GetObjectKeyCriteria
CriteriaOperator GetObjectKeyCriteria(ITypeInfo typeInfo, IEnumerable<XElement> xElements)
{
string criteria = "";
var parameters=new List<object>();
foreach (var xElement in xElements) {
var name = xElement.GetAttributeValue("name");
parameters.Add(XpandReflectionHelper.ChangeType(xElement.Value, typeInfo.FindMember(name).MemberType));
criteria += name + "=? AND ";
}
return CriteriaOperator.Parse(criteria.TrimEnd("AND ".ToCharArray()),parameters.ToArray());
}
示例6: TypeMatch
bool TypeMatch(ITypeInfo typeInfo, FilterProviderBase provider1) {
return ((!typeInfo.IsInterface && provider1.ObjectType == null || provider1.ObjectType == typeInfo.Type) && typeInfo.FindMember(provider1.FilterMemberName) == null && typeInfo.IsPersistent) && !ModelSystemTablesNodesGenerator.SystemTables.Contains(typeInfo.Name);
}
示例7: MemberInfo
static IMemberInfo MemberInfo(ITypeInfo roleTypeInfo, SecurityOperationsAttribute operationsAttribute) {
return roleTypeInfo.FindMember(operationsAttribute.OperationProviderProperty);
}
示例8: HandleErrorComplex
private void HandleErrorComplex(XElement objectElement, ITypeInfo typeInfo, Action action) {
var memberInfo = typeInfo.FindMember(objectElement.Parent.GetAttributeValue("name"));
if (memberInfo != null) {
action.Invoke();
} else {
HandleError(objectElement, FailReason.PropertyNotFound);
}
}
示例9: AssignValue
Action<string> AssignValue(object createObject, JobDataMap jobDataMap, ITypeInfo typeInfo) {
return s => {
var memberInfo = typeInfo.FindMember(s);
if (memberInfo != null) memberInfo.SetValue(createObject, jobDataMap[s]);
};
}