Exemplo n.º 1
0
        public ReloadingResource(ResourceReloader resourceReloader, string resourceName)
        {
#if DEBUG && !IOS
            this.resourceReloader = resourceReloader;
            this.resourceName     = resourceName;

            watcher   = new FileSystemWatcher();
            debugPath = $"../../../../Shared/Content/{resourceName}";

            watcher.Path     = Path.GetDirectoryName(debugPath);
            watcher.Filter   = Path.GetFileName(debugPath) + ".*";
            watcher.Changed += (_, __) => {
                resourceReloader.TriggerReload(resourceName);
            };
            watcher.EnableRaisingEvents = true;

            resourceReloader.Register(resourceName, this);
#endif
        }