示例#1
0
        public override bool Equals(object obj)
        {
            PropMap map = obj as PropMap;

            if (map != null)
            {
                return(this.SourceType.Equals(map.SourceType) && this.DestinationType.Equals(map.DestinationType) && this.ListControlAction.Equals(map.ListControlAction));
            }

            return(false);
        }
示例#2
0
        private PropMap CreatePropMap(Type sourceType, Type destType, ListControlActionType actionType)
        {
            PropMap map = new PropMap(sourceType, destType, actionType);

            if (Maps.Any(m => m.Equals(map)))
            {
                throw new InvalidOperationException("Same map already added.");
            }

            Maps.Add(map);
            return(map);
        }
示例#3
0
        public IEnumerable <LambdaExpression> FindResolution(Type sourceType, Type destType, ListControlActionType actionType, string memberName)
        {
            PropMap map = Maps
                          .Where(m => m.SourceType == sourceType && m.DestinationType == destType && (m.ListControlAction == actionType || m.ListControlAction == ListControlActionType.Common))
                          .OrderByDescending(m => m.ListControlAction)
                          .FirstOrDefault();

            if (map != null && map.Members.ContainsKey(memberName))
            {
                return(map.Members[memberName]);
            }

            return(null);
        }
示例#4
0
 internal PropMapExpr(PropMap map)
 {
     _map = map;
 }