Beispiel #1
0
        public bool Resolve(Type table, Identifier identifier, out Type resultTable, out String column)
        {
            if (identifier.Parts.Count == 1)
            {
                resultTable = table;
                column      = identifier.Parts[0];
                return(true);
            }
            PropertyInfo propertyInfo = table.GetProperty(identifier.Parts[0]);

            return(Resolve(propertyInfo.PropertyType, identifier.RemovePrefix(1), out resultTable, out column));
        }
Beispiel #2
0
 public bool Resolve(Type table, Identifier identifier, out Type resultTable, out String column)
 {
     if (identifier.Parts.Count == 1)
     {
         resultTable = table;
         column = identifier.Parts[0];
         return true;
     }
     PropertyInfo propertyInfo = table.GetProperty(identifier.Parts[0]);
     return Resolve(propertyInfo.PropertyType, identifier.RemovePrefix(1), out resultTable, out column);
 }
Beispiel #3
0
 private static Identifier JoinIds(Identifier prefix, Identifier suffix,
     Func<Identifier, Identifier> modPrefix)
 {
     return new Identifier(modPrefix(new Identifier(prefix, suffix.Parts[0])), suffix.RemovePrefix(1));
 }
Beispiel #4
0
        private static TreeNode FindNode(TreeNodeCollection nodes, Identifier id)
        {
            if (id.Parts.Count > 0)
            {
                foreach (TreeNode node in nodes)
                {
                    if (Equals(node.Text, id.Parts[0]))
                    {
                        if (id.Parts.Count == 1)
                            return node;
                        if (node.Nodes.Count == 0)
                            return null;

                        return FindNode(node.Nodes, id.RemovePrefix(1));
                    }
                }
            }
            return null;
        }
Beispiel #5
0
 private static Identifier JoinIds(Identifier prefix, Identifier suffix,
                                   Func <Identifier, Identifier> modPrefix)
 {
     return(new Identifier(modPrefix(new Identifier(prefix, suffix.Parts[0])), suffix.RemovePrefix(1)));
 }