Пример #1
0
        public static IProjectItemsFilter GetFilterForProject(Project project)
        {
            if (project == null)
                throw new ArgumentNullException("project");

            if (!project.Globals.get_VariableExists(ProjectLinkerExcludeFilterKey))
            {
                SetFilterForProject(project, DefaultFilterExpressions);
            }
            string excludeFilterExpressions = (string) project.Globals[ProjectLinkerExcludeFilterKey];

            IProjectItemsFilter filter = new RegexProjectItemsFilter(excludeFilterExpressions.Split(new[] {';'},
                                                                                                    StringSplitOptions.
                                                                                                        RemoveEmptyEntries));

            return filter;
        }
 public void ShouldFilterOutItem()
 {
     var filter = new RegexProjectItemsFilter(new[] {@"\.xaml"});
     Assert.IsFalse(filter.CanBeSynchronized(@"c:\myTestString.xaml"));
 }
 public void ShouldThrowOnInvalidArgument()
 {
     var filter = new RegexProjectItemsFilter(null);
 }
 public void ShouldCreateFilter()
 {
     var filter = new RegexProjectItemsFilter(new[] {".*"});
 }