本文整理汇总了C#中XPClassInfo类的典型用法代码示例。如果您正苦于以下问题:C# XPClassInfo类的具体用法?C# XPClassInfo怎么用?C# XPClassInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XPClassInfo类属于命名空间,在下文中一共展示了XPClassInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddTableNames
void AddTableNames(XPClassInfo xpClassInfo, string key) {
List<string> list = _tables[key];
list.Add(xpClassInfo.TableName);
foreach (var tableName in GetIntermediateTableNames(xpClassInfo).Where(tableName => !list.Contains(tableName))) {
list.Add(tableName);
}
}
示例2: GetDictionary
public ReflectionDictionary GetDictionary(XPClassInfo xpClassInfo) {
string key = GetKey(xpClassInfo);
var reflectionDictionary = GetDictionary(key);
if (xpClassInfo.IsPersistent)
AddTableNames(xpClassInfo, key);
return reflectionDictionary;
}
示例3: updateObjectType
// private void createObjectTypeColumn(XPClassInfo xpClassInfo, UnitOfWork unitOfWork)
// {
// unitOfWork.CreateObjectTypeRecords(xpClassInfo);
// var newObject = xpClassInfo.CreateNewObject(unitOfWork);
// unitOfWork.CommitChanges();
// unitOfWork.Delete(newObject);
// unitOfWork.CommitChanges();
// }
private void updateObjectType(UnitOfWork unitOfWork, XPClassInfo xpClassInfo, XPClassInfo mergedXPClassInfo, IDbCommand command)
{
var propertyName = XPObject.Fields.ObjectType.PropertyName;
command.CommandText = "UPDATE [" + getTableName(mergedXPClassInfo) + "] SET " + propertyName + "=" + unitOfWork.GetObjectType(xpClassInfo).Oid +
" WHERE " + propertyName + " IS NULL OR " + propertyName + "=" +unitOfWork.GetObjectType(mergedXPClassInfo).Oid;
command.ExecuteNonQuery();
}
示例4: DCPropertyInfos
IEnumerable<DCPropertyInfo> DCPropertyInfos(XPClassInfo classInfo) {
if (classInfo != null){
var xpandCalcMemberInfos = classInfo.OwnMembers.OfType<XpandCustomMemberInfo>();
return xpandCalcMemberInfos.Select(info => DcPropertyInfo(classInfo, info));
}
return Enumerable.Empty<DCPropertyInfo>();
}
示例5: getTableName
string getTableName(XPClassInfo mergedXPClassInfo) {
string tableName = mergedXPClassInfo.TableName;
while (mergedXPClassInfo.BaseClass != null && mergedXPClassInfo.BaseClass.IsPersistent) {
mergedXPClassInfo = mergedXPClassInfo.BaseClass;
tableName = mergedXPClassInfo.TableName;
}
return tableName;
}
示例6: Synchonize
protected virtual void Synchonize(object persistentPivotOption, Type type, XPClassInfo classInfo) {
var gridOptionInstances = GetGridOptionInstance(type);
foreach (var gridOptionInstance in gridOptionInstances) {
var propertyInfos = gridOptionInstance.GetType().GetProperties().Where(propertyInfo => propertyInfo.GetSetMethod() != null);
foreach (var propertyInfo in propertyInfos) {
classInfo.GetMember(propertyInfo.Name).SetValue(persistentPivotOption, propertyInfo.GetValue(gridOptionInstance, null));
}
}
}
示例7: DCPropertyInfo
public DCPropertyInfo(string name, Type propertyType, XPClassInfo declaringType, bool canRead, bool canWrite, XpandCustomMemberInfo xpandCustomMemberInfo) {
_nameCore = name;
_propertyTypeCore = propertyType;
_declaringTypeCore = declaringType;
_canReadCore = canRead;
_canWriteCore = canWrite;
_xpandCustomMemberInfo = xpandCustomMemberInfo;
_attributesCore.AddRange(xpandCustomMemberInfo.Attributes);
}
示例8: GetNextSequence
long GetNextSequence(XPClassInfo classInfo, string preFix) {
if (classInfo == null)
throw new ArgumentNullException("classInfo");
var objectByKey = _explicitUnitOfWork.GetObjectByKey(_sequenceObjectType, preFix + classInfo.FullName, true);
_sequence = objectByKey != null ? (ISequenceObject)objectByKey : CreateSequenceObject(preFix + classInfo.FullName, _explicitUnitOfWork);
long nextId = _sequence.NextSequence;
_sequence.NextSequence++;
_explicitUnitOfWork.FlushChanges();
return nextId;
}
示例9: GetMemberInfo
static XpandCustomMemberInfo GetMemberInfo(IModelRuntimeMember modelMember, XPClassInfo xpClassInfo) {
if (modelMember is IModelRuntimeCalculatedMember)
return xpClassInfo.CreateCalculabeMember(modelMember.Name, modelMember.Type,
new Attribute[] { new PersistentAliasAttribute(((IModelRuntimeCalculatedMember)modelMember).AliasExpression) });
if (modelMember is IModelRuntimeOrphanedColection) {
var modelRuntimeOrphanedColection = ((IModelRuntimeOrphanedColection)modelMember);
return xpClassInfo.CreateCollection(modelMember.Name, modelRuntimeOrphanedColection.CollectionType.TypeInfo.Type,
modelRuntimeOrphanedColection.Criteria);
}
return xpClassInfo.CreateCustomMember(modelMember.Name, modelMember.Type, modelMember is IModelRuntimeNonPersistentMember);
}
示例10: GetMemberInfo
static XpandCustomMemberInfo GetMemberInfo(IModelRuntimeMember modelMember, XPClassInfo xpClassInfo) {
var calculatedMember = modelMember as IModelRuntimeCalculatedMember;
if (calculatedMember != null)
return xpClassInfo.CreateCalculabeMember(calculatedMember.Name, calculatedMember.Type, calculatedMember.AliasExpression);
var member = modelMember as IModelRuntimeOrphanedColection;
if (member != null) {
var modelRuntimeOrphanedColection = member;
return xpClassInfo.CreateCollection(member.Name, modelRuntimeOrphanedColection.CollectionType.TypeInfo.Type,
modelRuntimeOrphanedColection.Criteria);
}
return xpClassInfo.CreateCustomMember(modelMember.Name, modelMember.Type, modelMember is IModelRuntimeNonPersistentMember);
}
示例11: GetSelectFilterCriteria
/// <contentfrom cref="ISecurityRule.GetSelectFilterCriteria" />
public bool GetSelectFilterCriteria(DevExpress.Xpo.SecurityContext context, XPClassInfo classInfo, out CriteriaOperator criteria)
{
List<CriteriaOperator> subList = new List<CriteriaOperator>();
CriteriaOperator subCriteria;
foreach (ISecurityRule rule in rules)
if (rule.GetSelectFilterCriteria(context, classInfo, out subCriteria))
subList.Add(subCriteria);
if (subList.Count == 0)
criteria = null;
else if (subList.Count == 1)
criteria = subList[0];
else
criteria = new GroupOperator(GroupOperatorType.And, subList.ToArray());
return subList.Count > 0;
}
示例12: GetSelectMemberExpression
/// <contentfrom cref="ISecurityRule.GetSelectMemberExpression" />
public bool GetSelectMemberExpression(DevExpress.Xpo.SecurityContext context, XPClassInfo classInfo, XPMemberInfo memberInfo, out CriteriaOperator expression)
{
CriteriaOperator subExpression;
expression = null;
foreach (ISecurityRule rule in rules)
if (rule.GetSelectMemberExpression(context, classInfo, memberInfo, out subExpression))
{
if (ReferenceEquals(expression, null))
expression = subExpression;
else if (!CriteriaOperator.CriterionEquals(expression, subExpression))
{
expression = new OperandValue(null);
return true;
}
}
return !ReferenceEquals(expression, null);
}
示例13: MapManyToMany
void MapManyToMany(XPDictionary outputDictionary, XPDictionary inputDictionary, XPClassInfo classInfo) {
foreach (var memberInfo in ManyToManyMemberInfos(classInfo)) {
var initialDataAttribute = (InitialDataAttribute)memberInfo.FindAttributeInfo(typeof(InitialDataAttribute));
var className = initialDataAttribute.DataProviderTableName;
if (initialDataAttribute.DataProvider && inputDictionary.QueryClassInfo(null, className) == null) {
CreateIntermediateClassInfo(outputDictionary, inputDictionary, className, initialDataAttribute, memberInfo);
}
}
}
示例14: InputObjectClassInfo
public InputObjectClassInfo(XPDictionary dictionary, string className, XPClassInfo outputClassInfo)
: base(dictionary, null, className, GetAttributes()) {
Guard.ArgumentNotNull(outputClassInfo, "outputClassInfo");
_outputClassInfo = outputClassInfo;
}
示例15: CreateAllOwnMembers
void CreateAllOwnMembers(XPClassInfo outputClassInfo, XPClassInfo inputClassInfo) {
foreach (var memberInfo in MemberInfos(outputClassInfo)) {
if (memberInfo.HasAttribute(typeof(InitialDataAttribute))) {
CreateMemberFromAttribute(inputClassInfo, memberInfo);
} else {
CreateMemberCore(inputClassInfo, memberInfo.Name, memberInfo);
}
}
}