Ejemplo n.º 1
0
        private void SetChildrenImpl(IEnumerable <MemberInfo> members, bool verifyReflectedType)
        {
            foreach (var member in members)
            {
                if (verifyReflectedType && !member.ReflectedType.IsAssignableFrom(ValueType))
                {
                    var msg = string.Format(
                        @"Member of ""{0}"" expected, got ""{1}"".",
                        ValueType, member.ReflectedType);
                    throw new ArgumentException(msg, "members");
                }

                var child = GetChild(member);
                if (child != null)
                {
                    continue;
                }

                var childName  = member.Name;
                var childState = DrawerStates.Get(HierarchicalName + '.' + childName);
                child = ValueDrawer.Create(
                    member.DeclaringType, MemberInfoUtil.MemberTypeOf(member), childName, null, childState);
                Assert.IsTrue(AddMapping(member, child), string.Format(
                                  @"Failed to add member mapping from ""{0}"" to ""{1}"".", member, child.HierarchicalName));
            }
        }
Ejemplo n.º 2
0
        private ValueDrawer CreateDrawer(UObject[] objects, UObject obj, int index)
        {
            var valueEntry = SelectionEntryFactory.Create(obj.GetType(), objects, index);
            var drawer     = ValueDrawer.Create(valueEntry.TypeOfOwner, valueEntry.TypeOfValue, objects[index].name);

            drawer.ValueEntry      = valueEntry;
            drawer.SelfVisible     = true;
            drawer.ChildrenVisible = true;
            return(drawer);
        }