/// <summary>
        /// Process parameters and create the filter list.
        /// </summary>
        protected override void InitializeFilters()
        {
            ProcessParameter(PublicFilter, !Force.IsPresent);
            ProcessParameter(AbstractFilter, Abstract.IsPresent);
            ProcessParameter(InterfaceFilter, Interface.IsPresent);
            ProcessParameter(ValueTypeFilter, ValueType.IsPresent);
            ProcessParameter <Type>(ParentFilter, InheritsType);
            ProcessParameter <Type>(ImplementsFilter, ImplementsInterface);
            ProcessNameParameters();

            if (FilterScript != null)
            {
                var filter = new ReflectionFilter(
                    (type, criteria) =>
                {
                    return(LanguagePrimitives.IsTrue(
                               FilterScript.InvokeWithContext(
                                   null,
                                   new List <PSVariable>()
                    {
                        new PSVariable("_", type)
                    },
                                   type)));
                });
                ProcessParameter(filter, true);
            }
        }
        /// <summary>
        /// Process input parameters and create the filter set.
        /// </summary>
        protected override void InitializeFilters()
        {
            _flags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static;
            if (Force.IsPresent)
            {
                _flags |= BindingFlags.NonPublic;
            }

            if (Static.IsPresent && !Instance.IsPresent)
            {
                _flags &= ~BindingFlags.Instance;
            }

            if (Instance.IsPresent && !Static.IsPresent)
            {
                _flags &= ~BindingFlags.Static;
            }

            if (!Not.IsPresent)
            {
                ProcessParameter(SpecialNameFilter, !IncludeSpecialName.IsPresent);
            }

            ProcessName(Name, WildcardNameFilter, RegexNameFilter);
            ProcessParameter <Type>(ParameterTypeFilter, ParameterType);
            ProcessParameter <Type>(ReturnTypeFilter, ReturnType);
            ProcessParameter((m, fc) => m is MethodInfo method ? method.IsAbstract : false, Abstract.IsPresent);
            ProcessParameter((m, fc) => m is MethodInfo method ? method.IsVirtual : false, Virtual.IsPresent);

            if (FilterScript != null)
            {
                var filter = new ReflectionFilter(
                    (type, criteria) =>
                {
                    return(LanguagePrimitives.IsTrue(
                               FilterScript.InvokeWithContext(
                                   null,
                                   new List <PSVariable>()
                    {
                        new PSVariable("_", type)
                    },
                                   type)));
                });
                ProcessParameter(filter, true);
            }
        }
Beispiel #3
0
 /// <summary>
 /// Process parameters and create the filter list.
 /// </summary>
 protected override void InitializeFilters()
 {
     ProcessName(Name, WildcardNameFilter, RegexNameFilter);
     ProcessName(FullName, WildcardNamespaceFilter, RegexNamespaceFilter);
     if (FilterScript != null)
     {
         var filter = new ReflectionFilter(
             (ns, criteria) =>
         {
             return(LanguagePrimitives.IsTrue(
                        FilterScript.InvokeWithContext(
                            null,
                            new List <PSVariable>()
             {
                 new PSVariable("_", ns)
             },
                            ns)));
         });
         ProcessParameter(filter, true);
     }
 }
Beispiel #4
0
        private void зеркальноПоГоризонталиToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Filter filter = new ReflectionFilter(false);

            backgroundWorker1.RunWorkerAsync(filter);
        }
        /// <summary>
        /// Black and White
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ReflectionMenu_Click(object sender, RoutedEventArgs e)
        {
            IImageFilter bw = new ReflectionFilter();

            this.UseFilter(bw);
        }
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FilterFrame{TMemberType}"/> class.
 /// </summary>
 /// <param name="filter">The filter to invoke.</param>
 /// <param name="criteria">The criteria to pass to the filter.</param>
 public FilterFrame(ReflectionFilter filter, object criteria)
 {
     Filter   = filter;
     Criteria = criteria;
 }