Example #1
0
        private void TextEditorEvents_LineChanged(TextPoint StartPoint, TextPoint EndPoint, int Hint)
        {
            var textDocument = EndPoint.Parent;
            if (textDocument == null) return;

            var document = textDocument.Parent;
            if (document == null) return;

            ProjectItem projectItem = null;
            try
            {
                projectItem = document.ProjectItem;
            }
            catch
            {
                /* dynamic dll document*/
                var kind = document.Kind;
            }
            if (projectItem == null) return;

            var projectName = DTEHelper.GetFullPathProject(projectItem.ContainingProject);
            if (string.IsNullOrWhiteSpace(projectName)) return;

            var parameter = new FileChangedArgument(projectName, document.FullName, false);
            DeferredAction daction;
            if (!_deferredActions.TryGetValue(parameter, out daction))
            {
                daction = _deferredActions[parameter] = new DeferredAction(() =>
                {
                    DebugPane.WriteLine($"{parameter.ProjectName}  ({parameter.FileName})");
                    PerformActions(EventType.FileChanged, parameter);
                });
            }

            daction.Run();
        }
Example #2
0
 private static bool CheckMask(FileChangedArgument mask, FileChangedArgument other)
 {
     return MathRegex(mask.ProjectName, other.ProjectName) &&
         MathRegex(mask.FileName, other.FileName);
 }
Example #3
0
 private bool CanExecuteWhenFileChanged(FileChangedArgument arg)
 {
     return _fileChangedMasks.Any(_ => _.Equals(arg));
 }