Example #1
0
        private Loader(Basics.Configuration.IXeora configuration, Action <string, string> reloadHandler)
        {
            this._CacheRootLocation =
                System.IO.Path.Combine(
                    configuration.Application.Main.TemporaryRoot,
                    configuration.Application.Main.WorkingPath.WorkingPathId
                    );

            if (!Directory.Exists(this._CacheRootLocation))
            {
                Directory.CreateDirectory(this._CacheRootLocation);
            }

            this._DomainRootLocation =
                System.IO.Path.GetFullPath(
                    System.IO.Path.Combine(
                        configuration.Application.Main.PhysicalRoot,
                        configuration.Application.Main.ApplicationRoot.FileSystemImplementation,
                        "Domains"
                        )
                    );

            this._Watcher =
                new Watcher(this._DomainRootLocation, () =>
            {
                Basics.Console.Push(string.Empty, "Library changes have been detected!", string.Empty, false, true);

                // Reload
                this.Load();

                // Notify
                reloadHandler?.Invoke(this.Id, this.Path);
            });
        }
Example #2
0
 public static void Initialize(Basics.Configuration.IXeora configuration, Action <string, string> reloadHandler)
 {
     Loader.Current ??= new Loader(configuration, reloadHandler);
     Loader.Current.Load();
 }