private void DotNetProject_Modified(object sender, SolutionItemModifiedEventArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            ForegroundDispatcher.AssertForegroundThread();

            if (_batchingProjectChanges)
            {
                // Already waiting to recompute host project, no need to do any more work to determine if we're dirty.
                return;
            }

            var projectChanged = args.Any(arg => string.Equals(arg.Hint, ProjectChangedHint, StringComparison.Ordinal));

            if (projectChanged)
            {
                // This method can be spammed for tons of project change events but all we really care about is "are we dirty?".
                // Therefore, we re-dispatch here to allow any remaining project change events to fire and to then only have 1 host
                // project change trigger; this way we don't spam our own system with re-configure calls.
                _batchingProjectChanges = true;
                Task.Factory.StartNew(ProjectChangedBackgroundAsync, null, CancellationToken.None, TaskCreationOptions.None, ForegroundDispatcher.BackgroundScheduler);
            }
        }
Пример #2
0
 void HandleProjectModified(object sender, SolutionItemModifiedEventArgs e)
 {
     if (!e.Any(x => x.Hint == "TargetFramework" || x.Hint == "References"))
     {
         return;
     }
     StartReparseThread();
 }
Пример #3
0
 protected override void OnModified(SolutionItemModifiedEventArgs args)
 {
     base.OnModified(args);
     if (args.Any(r => r.Hint == Helpers.RhinoPluginTypeProperty))
     {
         // refresh the rhino project type
         RefreshRhinoProjectType();
     }
 }
Пример #4
0
 void OnProjectModified(object s, SolutionItemModifiedEventArgs args)
 {
     if (!args.Any(x => x is SolutionItemModifiedEventInfo && ((SolutionItemModifiedEventInfo)x).Hint == "TargetFramework"))
     {
         return;
     }
     if (UpdateFromProject())
     {
         SourceProjectDom.UpdateReferences();
     }
 }