예제 #1
0
 public async ValueTask <bool> TryHandleFileChange(DotNetWatchContext context, FileItem file, CancellationToken cancellationToken)
 {
     return
         (await _staticFileHandler.TryHandleFileChange(context, file, cancellationToken) ||
          await _scopedCssFileHandler.TryHandleFileChange(context, file, cancellationToken) ||
          await _compilationHandler.TryHandleFileChange(context, file, cancellationToken));
 }
예제 #2
0
        public async ValueTask <bool> TryHandleFileChange(DotNetWatchContext context, FileItem file, CancellationToken cancellationToken)
        {
            HotReloadEventSource.Log.HotReloadStart(HotReloadEventSource.StartType.Main);
            var fileHandlerResult = await _staticFileHandler.TryHandleFileChange(context, file, cancellationToken) ||
                                    await _scopedCssFileHandler.TryHandleFileChange(context, file, cancellationToken) ||
                                    await _compilationHandler.TryHandleFileChange(context, file, cancellationToken);

            HotReloadEventSource.Log.HotReloadEnd(HotReloadEventSource.StartType.Main);
            return(fileHandlerResult);
        }
예제 #3
0
        public async ValueTask <bool> TryHandleFileChange(DotNetWatchContext context, FileItem file, CancellationToken cancellationToken)
        {
            if (await _staticFileHandler.TryHandleFileChange(context, file, cancellationToken))
            {
                return(true);
            }

            if (await _compilationHandler.TryHandleFileChange(context, file, cancellationToken)) // This needs to be 6.0
            {
                return(true);
            }

            return(false);
        }
예제 #4
0
        public async ValueTask <bool> TryHandleFileChange(DotNetWatchContext context, FileItem[] files, CancellationToken cancellationToken)
        {
            HotReloadEventSource.Log.HotReloadStart(HotReloadEventSource.StartType.Main);

            var fileHandlerResult = false;

            for (var i = files.Length - 1; i >= 0; i--)
            {
                var file = files[i];
                if (await _staticFileHandler.TryHandleFileChange(context, file, cancellationToken) ||
                    await _scopedCssFileHandler.TryHandleFileChange(context, file, cancellationToken))
                {
                    fileHandlerResult = true;
                }
            }

            fileHandlerResult |= await _compilationHandler.TryHandleFileChange(context, files, cancellationToken);

            HotReloadEventSource.Log.HotReloadEnd(HotReloadEventSource.StartType.Main);
            return(fileHandlerResult);
        }