Example #1
0
        /// <summary>
        /// Checks if the file or directory is ok for refactoring
        /// </summary>
        private static bool IsValidFile(string file)
        {
            IProject project = PluginBase.CurrentProject;

            return(project != null &&
                   RefactoringHelper.IsProjectRelatedFile(project, file) &&
                   Regex.Match(Path.GetFileNameWithoutExtension(file), REG_IDENTIFIER, RegexOptions.Singleline).Success &&
                   (Directory.Exists(file) || FileHelper.FileMatchesSearchFilter(file, project.DefaultSearchFilter)));
        }
Example #2
0
        /// <summary>
        /// Checks if the file or directory is ok for refactoring
        /// </summary>
        private bool IsValidFile(string file)
        {
            IProject project = PluginBase.CurrentProject;

            if (project == null ||
                !RefactoringHelper.IsProjectRelatedFile(project, file) ||
                !Regex.Match(Path.GetFileNameWithoutExtension(file), REG_IDENTIFIER, RegexOptions.Singleline).Success)
            {
                return(false);
            }
            if (Directory.Exists(file))
            {
                return(true);
            }
            return(FileHelper.FileMatchesSearchFilter(file, project.DefaultSearchFilter));
        }
Example #3
0
        /// <summary>
        /// Checks if the file or directory is ok for refactoring
        /// </summary>
        private bool IsValidFile(string file)
        {
            IProject project = PluginBase.CurrentProject;

            if (project == null ||
                !RefactoringHelper.IsProjectRelatedFile(project, file) ||
                !Regex.Match(Path.GetFileNameWithoutExtension(file), REG_IDENTIFIER, RegexOptions.Singleline).Success)
            {
                return(false);
            }
            if (Directory.Exists(file))
            {
                return(true);
            }
            string ext = Path.GetExtension(file);

            return((ext == ".as" || ext == ".hx" || ext == ".ls") && project.DefaultSearchFilter.Contains(ext));
        }
Example #4
0
        /// <summary>
        /// Checks if the file or directory is ok for refactoring
        /// </summary>
        private bool IsValidFile(string file)
        {
            IProject project = PluginBase.CurrentProject;

            if (project == null)
            {
                return(false);
            }
            if (!RefactoringHelper.IsProjectRelatedFile(project, file))
            {
                return(false);
            }
            if (Directory.Exists(file))
            {
                return(true);
            }
            string ext = Path.GetExtension(file);

            return((ext == ".as" || ext == ".hx" || ext == ".ls") && project.DefaultSearchFilter.Contains(ext));
        }