当前位置: 首页>>代码示例>>C#>>正文


C# IClassDef.GetPropDef方法代码示例

本文整理汇总了C#中IClassDef.GetPropDef方法的典型用法代码示例。如果您正苦于以下问题:C# IClassDef.GetPropDef方法的具体用法?C# IClassDef.GetPropDef怎么用?C# IClassDef.GetPropDef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IClassDef的用法示例。


在下文中一共展示了IClassDef.GetPropDef方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetPropDefByPropName

        /// <summary>
        /// Finds the property definition with the given name for the specified
        /// class definition.  This method will search through an inheritance
        /// structure or relationship if needed.
        /// </summary>
        /// <param name="classDef">The class definition containing either the property
        /// or containing inheritance or relationship structures that might hold
        /// the property</param>
        /// <param name="propertyName">The name of the property.  A related property can
        /// be described by "RelationshipName.PropertyName".</param>
        /// <returns></returns>
        public static IPropDef GetPropDefByPropName(IClassDef classDef, string propertyName)
        {
            if (classDef == null || IsReflectiveProperty(propertyName))
            {
                return null;
            }
/*            if (IsRelatedProperty(propertyName))
            {
                string relationshipName = propertyName.Substring(0, propertyName.IndexOf("."));
                propertyName = propertyName.Remove(0, propertyName.IndexOf(".") + 1);
                List<string> relNames = new List<string>();
                relNames.AddRange(relationshipName.Split(new[]{"|"}, StringSplitOptions.RemoveEmptyEntries));
                IRelationshipDefCol relationshipDefCol = classDef.RelationshipDefCol;
                IPropDef propDef = null;
                foreach (string relName in relNames)
                {
                    if (relationshipDefCol.Contains(relName))
                    {
                        IRelationshipDef relationshipDef = relationshipDefCol[relName];
                        IClassDef relatedClassDef = relationshipDef.RelatedObjectClassDef;
                        propDef = GetPropDefByPropName(relatedClassDef, propertyName);
                    }
                    if (propDef != null)
                    {
                        return propDef;
                    }
                }
                return null;
            }*/
            return classDef.GetPropDef(propertyName, false);
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:42,代码来源:ClassDefHelper.cs

示例2: GetPropDef

        private static IPropDef GetPropDef(IClassDef classDef, IUIGridColumn gridColumn)
        {
            /*            IPropDef propDef = null;
                        if (classDef.PropDefColIncludingInheritance.Contains(gridColumn.PropertyName))
                        {
                            propDef = classDef.PropDefColIncludingInheritance[gridColumn.PropertyName];
                        }*/

            return classDef.GetPropDef(gridColumn.PropertyName, false);
        }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:10,代码来源:TestGridInitialiser.cs

示例3: GetPropDef

 protected static ISingleValueDef GetPropDef(IClassDef classDef, string propName, bool raiseErrIfNotExists)
 {
     ISingleValueDef def = classDef.GetPropDef(propName, false);
     if (raiseErrIfNotExists) ValidateProp(classDef.ClassType, def, propName);
     return def;
 }
开发者ID:Chillisoft,项目名称:habanero.testability,代码行数:6,代码来源:BOTestFactory.cs

示例4: GetPropDef

 private static IPropDef GetPropDef(IClassDef classDef, IUIGridColumn gridColumn)
 {
     IPropDef propDef = classDef.GetPropDef(gridColumn.PropertyName, false);
     return propDef;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:5,代码来源:GridBaseInitialiser.cs

示例5: PrepareField

 ///<summary>
 /// Prepares 
 ///</summary>
 ///<param name="currentSource"></param>
 ///<param name="classDef"></param>
 ///<param name="field"></param>
 ///<returns></returns>
 public static IPropDef PrepareField(Source currentSource, IClassDef classDef, QueryField field)
 {
     IClassDef classDefOfField = classDef;
     if (classDef.IsUsingClassTableInheritance())
         classDefOfField = classDef.GetPropDef(field.PropertyName).ClassDef;
     IClassDef fieldClassDef;
     PrepareSource(classDefOfField, ref currentSource, out fieldClassDef);
     field.Source = currentSource;
     if (fieldClassDef != null)
         return fieldClassDef.GetPropDef(field.PropertyName);
     return null;
 }
开发者ID:Celtic691,项目名称:habanero,代码行数:19,代码来源:QueryBuilder.cs

示例6: CreateOrderCriteria

        ///<summary>
        /// Based on the class definition and the orderByString an <see cref="OrderCriteria"/> object is created.
        /// The orderCriteria object is a set of order by fields including information on their 
        /// business object properties and their dataSource. 
        ///</summary>
        ///<param name="classDef">The class definition to use for building the order criteria</param>
        ///<param name="orderByString">The orderby string to use for creating the <see cref="OrderCriteria"/>.</param>
        ///<returns>the newly created <see cref="OrderCriteria"/> object.</returns>
        public static IOrderCriteria CreateOrderCriteria(IClassDef classDef, string orderByString)
        {
            if (classDef == null) throw new ArgumentNullException("classDef");
            IOrderCriteria orderCriteria = OrderCriteria.FromString(orderByString);
            try
            {
                //TODO Mark 20 Mar 2009: Souldn't the following code be stripped out into a PrepareOrderBy method that is called before loading? (Similar to PrepareCriteria)
                foreach (OrderCriteriaField field in orderCriteria.Fields)
                {
                    Source source = field.Source;
                    IClassDef relatedClassDef;
                    IClassDef classDefOfField = classDef;
                    if (classDef.IsUsingClassTableInheritance())
                        classDefOfField = classDef.GetPropDef(field.PropertyName).ClassDef;
                    PrepareSource(classDefOfField, ref source, out relatedClassDef);
                    field.Source = source;

                    IPropDef propDef = relatedClassDef.GetPropDef(field.PropertyName);
                    field.FieldName = propDef.DatabaseFieldName;
                    field.Source.ChildSourceLeaf.EntityName = relatedClassDef.GetTableName(propDef);
                }
                return orderCriteria;
            }
            catch (InvalidPropertyNameException)
            {
                throw new InvalidOrderCriteriaException("The orderByString '" + orderByString 
                        + "' is not valid for the classDef '" + classDef.ClassNameFull);
            }
        }
开发者ID:Celtic691,项目名称:habanero,代码行数:37,代码来源:QueryBuilder.cs

示例7: CreateQueryField

 /// <summary>
 /// Creates a <see cref="QueryField"/> given a classdef and a property name. 
 /// </summary>
 /// <param name="classDef"></param>
 /// <param name="propertyName"></param>
 /// <returns></returns>
 public static QueryField CreateQueryField(IClassDef classDef, string propertyName)
 {
     var propDef = classDef.GetPropDef(propertyName);
     var propClassDef = (ClassDef)propDef.ClassDef;
     var classNameExcludingTypeParameter = propClassDef.GetBaseClassOfSingleTableHierarchy().ClassNameExcludingTypeParameter;
     var propSource = new Source(classNameExcludingTypeParameter, propClassDef.GetTableName(propDef));
     return new QueryField(propDef.PropertyName, propDef.DatabaseFieldName, propSource);
 }
开发者ID:Celtic691,项目名称:habanero,代码行数:14,代码来源:QueryBuilder.cs

示例8: GetPropertyType

#pragma warning restore 612,618
        private static Type GetPropertyType(IClassDef classDef, string propertyName)
        {
            IPropDef def = classDef.GetPropDef(propertyName, false);
            if (def == null) return classDef.GetPropertyType(propertyName);
            var lookupList = def.LookupList;
            Type propertyType = def.PropertyType;
            if (lookupList != null && !(lookupList is NullLookupList))
            {
                propertyType = typeof(object);
            }
            return propertyType;
        }
开发者ID:kevinbosman,项目名称:habanero,代码行数:13,代码来源:DataSetProvider.cs


注:本文中的IClassDef.GetPropDef方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。