예제 #1
0
        public BindingRule[] GetRules()
        {
            var providers = this._root;

            IBindingRuleProvider root = (IBindingRuleProvider)providers;
            return root.GetRules().ToArray();
        }
예제 #2
0
 private void AddTypesFromGraph(IBindingRuleProvider root)
 {
     foreach (var rule in root.GetRules())
     {
         var type = rule.UserType as OpenType.ExactMatch;
         if (type != null)
         {
             AddAssembly(type.ExactType);
         }
     }
 }
예제 #3
0
        public IEnumerable <BindingRule> GetRules()
        {
            IBindingRuleProvider inner = _inner as IBindingRuleProvider;

            if (inner != null)
            {
                foreach (var rule in inner.GetRules())
                {
                    rule.Filter = FilterNode.And(_description, rule.Filter);
                    yield return(rule);
                }
            }
        }
예제 #4
0
        internal static void DumpRule(IBindingRuleProvider root, TextWriter output)
        {
            foreach (var rule in root.GetRules())
            {
                var attr = rule.SourceAttribute;

                output.Write($"[{attr.Name}] -->");
                if (rule.Filter != null)
                {
                    output.Write($"[filter: {rule.Filter}]-->");
                }

                if (rule.Converters != null)
                {
                    foreach (var converterType in rule.Converters)
                    {
                        output.Write($"{OpenType.ExactMatch.TypeToString(converterType)}-->");
                    }
                }

                output.Write(rule.UserType.GetDisplayName());
                output.WriteLine();
            }
        }