void AddPropertyHiddenDelegate(string property, Func<InstanceMember, bool> hiddenDelegate, TypeMemberDisplayProperties allProperties)
        {
            InstanceMemberDisplayProperties imdp = new InstanceMemberDisplayProperties();
            imdp.Name = property;
            imdp.IsHiddenDelegate = hiddenDelegate;

            allProperties.DisplayProperties.Add(imdp);
        }
        private InstanceMemberDisplayProperties GetOrCreateImdp(string name)
        {
            InstanceMemberDisplayProperties newImdp = DisplayProperties.FirstOrDefault(item => item.Name == name);
            if (newImdp == null)
            {
                newImdp = new InstanceMemberDisplayProperties();
                DisplayProperties.Add(newImdp);
                newImdp.Name = name;
            }

            return newImdp;
        }
Beispiel #3
0
        private InstanceMemberDisplayProperties GetOrCreateImdp(string name)
        {
            InstanceMemberDisplayProperties newImdp = DisplayProperties.FirstOrDefault(item => item.Name == name);

            if (newImdp == null)
            {
                newImdp = new InstanceMemberDisplayProperties();
                DisplayProperties.Add(newImdp);
                newImdp.Name = name;
            }

            return(newImdp);
        }
        private void ApplyDisplayPropertyToInstanceMember(InstanceMemberDisplayProperties displayProperties, InstanceMember member, MemberCategory category)
        {
            if (displayProperties.IsHiddenDelegate != null && mMembersWithOptionalVisibility.ContainsKey(member) == false)
            {
                mMembersWithOptionalVisibility.Add(member, displayProperties.IsHiddenDelegate);
            }

            //if (displayProperties.GetEffectiveIsHidden(member.Instance))
            // let's instead just use the hidden property - we will apply functions after
            if (displayProperties.IsHidden)
            {
                category.Members.Remove(member);
            }
            else
            {
                // Put an if-statement for debugging
                if (member.PreferredDisplayer != displayProperties.PreferredDisplayer)
                {
                    member.PreferredDisplayer = displayProperties.PreferredDisplayer;
                }
                member.DisplayName = displayProperties.DisplayName;
                if (!string.IsNullOrEmpty(displayProperties.Category) && category.Name != displayProperties.Category)
                {
                    category.Members.Remove(member);

                    MemberCategory newCategory = GetOrInstantiateAndAddMemberCategory(displayProperties.Category);
                    member.Category = newCategory;
                    newCategory.Members.Add(member);
                }

            }
        }
Beispiel #5
0
        public void SetDisplay(string name, string displayName)
        {
            InstanceMemberDisplayProperties newImdp = GetOrCreateImdp(name);

            newImdp.DisplayName = displayName;
        }
Beispiel #6
0
        public void SetPreferredDisplayer(string name, Type displayerType)
        {
            InstanceMemberDisplayProperties newImdp = GetOrCreateImdp(name);

            newImdp.PreferredDisplayer = displayerType;
        }
Beispiel #7
0
        public void SetCategory(string name, string category)
        {
            InstanceMemberDisplayProperties newImdp = GetOrCreateImdp(name);

            newImdp.Category = category;
        }
Beispiel #8
0
        public void AddIgnore(string name)
        {
            InstanceMemberDisplayProperties newImdp = GetOrCreateImdp(name);

            newImdp.IsHidden = true;
        }