예제 #1
0
 public override XQueryNodeIterator CreateCollection(string collection_name)
 {
     lock (m_dict)
     {
         XQueryNodeIterator res;
         if (m_dict.TryGetValue(collection_name, out res))
             return res.Clone();
         ResolveCollectionArgs args = new ResolveCollectionArgs();
         args.CollectionName = collection_name;
         if (m_command.OnResolveCollection != null)
         {
             m_command.OnResolveCollection(m_command, args);
             if (args.Collection != null)
             {
                 m_dict.Add(collection_name, args.Collection.Clone());
                 return args.Collection;
             }
         }
         throw new XQueryException(Properties.Resources.FODC0004, collection_name);
     }
 }
예제 #2
0
 void command_OnResolveCollection(object sender, ResolveCollectionArgs args)
 {
     if (args.CollectionName != String.Empty)
         args.Collection = CreateCollection((XQueryCommand)sender, args.CollectionName);
 }