private static Attributes GetMemberAttibutes(ComMember member)
        {
            var attributes = new Attributes();

            if (member.IsEnumerator)
            {
                attributes.AddEnumeratorMemberAttribute(member.Name);
            }
            else if (member.IsDefault)
            {
                attributes.AddDefaultMemberAttribute(member.Name);
            }
            else if (member.IsHidden)
            {
                attributes.AddHiddenMemberAttribute(member.Name);
            }
            else if (member.IsEvaluateFunction)
            {
                attributes.AddEvaluateMemberAttribute(member.Name);
            }
            else if (!string.IsNullOrEmpty(member.Documentation.DocString))
            {
                attributes.AddMemberDescriptionAttribute(member.Name, member.Documentation.DocString);
            }
            return(attributes);
        }
示例#2
0
        public void PropertySetsAreDefaultMembersIfTheyHaveTheDefaultMemberAttribute()
        {
            var attributes = new Attributes();

            attributes.AddDefaultMemberAttribute("test");
            var propertySet = GetTestPropertySet("test", attributes);

            Assert.IsTrue(propertySet.IsDefaultMember);
        }
示例#3
0
        public void SubroutinesAreDefaultMembersIfTheyHaveTheDefaultMemberAttribute()
        {
            var attributes = new Attributes();

            attributes.AddDefaultMemberAttribute("testSub");
            var subroutine = GetTestSub("testSub", attributes);

            Assert.IsTrue(subroutine.IsDefaultMember);
        }
        public void FunctionsAreDefaultMembersIfTheyHaveTheDefaultMemberAttribute()
        {
            var attributes = new Attributes();

            attributes.AddDefaultMemberAttribute("testFoo");
            var function = GetTestFunction("testFoo", attributes);

            Assert.IsTrue(function.IsDefaultMember);
        }
        private static Attributes GetPropertyAttibutes(ComField property)
        {
            var attributes = new Attributes();

            if (property.Flags.HasFlag(VARFLAGS.VARFLAG_FDEFAULTBIND))
            {
                attributes.AddDefaultMemberAttribute(property.Name);
            }
            if (property.Flags.HasFlag(VARFLAGS.VARFLAG_FHIDDEN))
            {
                attributes.AddHiddenMemberAttribute(property.Name);
            }
            return(attributes);
        }
        private static Attributes GetMemberAttibutes(ComMember member)
        {
            var attributes = new Attributes();

            if (member.IsEnumerator)
            {
                attributes.AddEnumeratorMemberAttribute(member.Name);
            }
            else if (member.IsDefault)
            {
                attributes.AddDefaultMemberAttribute(member.Name);
            }
            else if (member.IsHidden)
            {
                attributes.AddHiddenMemberAttribute(member.Name);
            }
            else if (member.IsEvaluateFunction)
            {
                attributes.AddEvaluateMemberAttribute(member.Name);
            }
            return(attributes);
        }