示例#1
0
 protected override List<IReference> GetImplementingReferences(IClass scope, ITransformationContext context)
 {
     var generatedType = context.Trace.ResolveIn(Rule<Class2Type>(), scope);
     var r2p = Rule<Reference2Property>();
     return (from c in scope.Closure(c => c.BaseTypes)
             from r in c.References
             where generatedType.Members.Contains(context.Trace.ResolveIn(r2p, r))
             select r).ToList();
 }
示例#2
0
            protected override List <IReference> GetImplementingReferences(IClass scope, ITransformationContext context)
            {
                var generatedType = context.Trace.ResolveIn(Rule <Class2Type>(), scope);
                var r2p           = Rule <Reference2Property>();

                return((from c in scope.Closure(c => c.BaseTypes)
                        from r in c.References
                        where generatedType.Members.Contains(context.Trace.ResolveIn(r2p, r))
                        select r).ToList());
            }
示例#3
0
 public ModelTestBase()
 {
     Class        = MetaRepository.Instance.ResolveClass(typeof(T)) as IClass;
     AllAncestors = Class.Closure(c => c.BaseTypes).ToList();
     foreach (var r in AllAncestors.SelectMany(c => c.References))
     {
         if (r.Refines != null && !refinesLookup.ContainsKey(r.Refines))
         {
             refinesLookup.Add(r.Refines, r);
         }
     }
     foreach (var attC in AllAncestors.SelectMany(c => c.AttributeConstraints))
     {
         fixedAttributes.Add(attC.Constrains);
     }
     foreach (var refC in AllAncestors.SelectMany(c => c.ReferenceConstraints))
     {
         if (!refinesLookup.ContainsKey(refC.Constrains))
         {
             refinesLookup.Add(refC.Constrains, null);
         }
     }
 }