private async void Reparse(object sender, FileSystemEventArgs e)
        {
            if (e != null && e.Name.ToLowerInvariant() != _localFileName)
            {
                return;
            }

            var       tryCount = 0;
            const int maxTries = 20;

            while (tryCount++ < maxTries)
            {
                try
                {
                    var text = File.ReadAllText(_file);

                    Reparse(text);

                    break;
                }
                catch (IOException)
                {
                }
                await Task.Delay(100);
            }

            await UsageRegistry.ResynchronizeAsync();

            if (IsProcessingUnusedCssRules)
            {
                UnusedCssExtension.All(x => x.SnapshotPage());
            }
        }
Beispiel #2
0
 private static void ResetUsageData(object sender, EventArgs e)
 {
     DocumentFactory.Clear();
     UsageRegistry.Reset();
     MessageDisplayManager.Refresh();
     UnusedCssExtension.All(x => x.BlipRecording());
 }
Beispiel #3
0
 private static void StopRecordAll(object sender, EventArgs e)
 {
     UnusedCssExtension.All(x => x.EnsureRecordingMode(false));
 }