Пример #1
0
        public static RecipeContext FromXml(ILookupAssemblies lookup, XmlDocument doc)
        {
            XmlElement root = doc.DocumentElement;

            if (root.LocalName != "nrdo.context")
            {
                throw new ArgumentException("Cannot create a context from a <" + root.LocalName + "> element");
            }
            RecipeContext result = new RecipeContext(lookup);

            foreach (XmlElement element in Recipe.elementChildren(root))
            {
                result.PutRecordRaw(RecipeRecord.FromXmlElement(result, element));
            }
            return(result);
        }
Пример #2
0
 private NrdoCodeBase(ILookupAssemblies lookup)
 {
     this.lookup = lookup;
 }
Пример #3
0
 internal static NrdoCodeBase Get(ILookupAssemblies lookup)
 {
     return(new NrdoCodeBase(lookup));
 }
Пример #4
0
 public RecipeContext(ILookupAssemblies lookup)
 {
     Lookup = lookup;
     RegisterTransformType("xslt", typeof(XsltTransformRecipe));
 }
Пример #5
0
 /// <summary>
 /// Gets all known tables. To determine which assemblies to load from, the given lookup strategy is used.
 /// </summary>
 /// <param name="lookup">The lookup strategy to use to find the appropriate assembly</param>
 /// <returns>NrdoTable objects corresponding to all known tables</returns>
 public static IEnumerable <NrdoQuery> GetAllQueries(ILookupAssemblies lookup)
 {
     return(NrdoReflection.GetCodeBase(lookup).AllQueries);
 }
Пример #6
0
 public static NrdoQuery GetQuery(ILookupAssemblies lookup, string name)
 {
     return(NrdoReflection.GetCodeBase(lookup).GetQuery(name));
 }
Пример #7
0
 /// <summary>
 /// Gets a NrdoTable object corresponding to the given table name. To determine which assembly to load from, the given
 /// lookup strategy is used.
 /// </summary>
 /// <param name="lookup">The lookup strategy to use to find the appropriate assembly</param>
 /// <param name="name">The name of the table to get</param>
 /// <returns>A NrdoTable object corresponding to the named table</returns>
 public static NrdoTable GetTable(ILookupAssemblies lookup, string name)
 {
     return(NrdoReflection.GetCodeBase(lookup).GetTable(name));
 }
Пример #8
0
 public static IDictionary <string, string> GetRenameMapping(ILookupAssemblies lookup)
 {
     return(NrdoReflection.GetCodeBase(lookup).GetTableRenameMapping());
 }
Пример #9
0
 public RecipeLoader(ILookupAssemblies lookup)
     : this(new RecipeContext(lookup))
 {
 }
Пример #10
0
 public static INrdoCodeBase GetCodeBase(ILookupAssemblies lookup)
 {
     return(NrdoCodeBase.Get(lookup));
 }