public static StonehengeResourceLoader CreateDefaultLoader(IStonehengeResourceProvider provider)
        {
            var assemblies = new List <Assembly>
            {
                Assembly.GetEntryAssembly(),
                Assembly.GetExecutingAssembly(),
                Assembly.GetAssembly(typeof(ResourceLoader)),
                Assembly.GetCallingAssembly()
            }
            .Distinct()
            .ToList();

            var resLoader = new ResourceLoader(assemblies, Assembly.GetCallingAssembly());

            if (provider != null)
            {
                resLoader.AddAssembly(provider.GetType().Assembly);
            }

            var path       = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) ?? Directory.GetCurrentDirectory();
            var fileLoader = new FileLoader(Path.Combine(path, "App"));

            var viewModelCreator = new ViewModelProvider();

            var loader = new StonehengeResourceLoader(new List <IStonehengeResourceProvider> {
                fileLoader, resLoader, viewModelCreator
            });

            if (provider != null)
            {
                loader.Loaders.Add(provider);
            }
            return(loader);
        }
Example #2
0
 public void InitProvider(StonehengeResourceLoader loader, StonehengeHostOptions options)
 {
     foreach (var provider in Providers)
     {
         provider.InitProvider(loader, options);
     }
 }
Example #3
0
 public void InitProvider(StonehengeResourceLoader loader, StonehengeHostOptions options)
 {
 }