Exemplo n.º 1
0
 public VisitStatus VisitCollectionProperty <TProperty2, TContainer2, TValue2>(TProperty2 property, ref TContainer2 container, ref ChangeTracker changeTracker)
     where TProperty2 : ICollectionProperty <TContainer2, TValue2>
 {
     if (Result)
     {
         int count = property.GetCount(ref container);
         for (int i = 0; i != count && Result; ++i)
         {
             var getter = new MemberInfoGetter <TContainer2>();
             property.GetPropertyAtIndex(ref container, i, ref changeTracker, ref getter);
             ContextMemberInfo info;
             if (getter.Found)
             {
                 info = new ContextMemberInfo(
                     ContextFieldInfo.MakeOperator("[" + i + "]")
                     , getter.Result
                     );
             }
             else
             {
                 // Unknown type
                 info = new ContextMemberInfo(
                     ContextFieldInfo.MakeOperator("[" + i + "]")
                     , new ContextTypeInfo()
                     );
             }
             Result = Visitor(info);
         }
     }
     return(VisitStatus.Handled);
 }
Exemplo n.º 2
0
 VisitStatus IPropertyVisitor.VisitProperty <TProperty2, TContainer2, TValue2>(TProperty2 property, ref TContainer2 container, ref ChangeTracker changeTracker)
 {
     if (Result)
     {
         var info = new ContextMemberInfo(
             ContextFieldInfo.Make(property.GetName()),
             ContextTypeInfo.MakeProperty(property)
             );
         Result = Visitor(info);
     }
     return(VisitStatus.Handled);
 }
Exemplo n.º 3
0
 public override bool VisitAllMembers(Func <ContextMemberInfo, bool> visitor)
 {
     foreach (var e in World.EntityManager.GetAllEntities())
     {
         var info = new ContextMemberInfo(ContextFieldInfo.MakeOperator($"[{e.Index}]"), ContextTypeInfo.Make(typeof(PropertyPathContext <EntityContainer, EntityContainer>)));
         if (!visitor(info))
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 4
0
        public override bool VisitAllMembers(Func <ContextMemberInfo, bool> visitor)
        {
            var comps = GO.GetComponents <Component>();

            for (int i = 0; i != comps.Length; ++i)
            {
                var info = new ContextMemberInfo(
                    ContextFieldInfo.MakeOperator($"[{i}]"),
                    ContextTypeInfo.Make(comps[i].GetType())
                    );
                if (!visitor(info))
                {
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 5
0
 public ScopeContext(IWatchContext parent, string relativePath, ContextMemberInfo info)
     : base(parent, relativePath, info)
 {
 }
Exemplo n.º 6
0
 public WatchContext(IWatchContext parent, string relativePath, ContextMemberInfo info)
 {
     Parent       = parent;
     RelativePath = relativePath;
     memberInfo   = info;
 }
Exemplo n.º 7
0
 public DictionaryContext(IWatchContext parent, string relativePath, ContextMemberInfo info)
     : base(parent, relativePath, info)
 {
 }