Пример #1
0
        public PropertyBuilder With(PropertyMemberBuilder builder, out IMember member)
        {
            if (build != null)
            {
                throw new Exception();
            }

            member = builder.Build(this);
            if (member is VariableDeclaration decl)
            {
                this.fields.Add(decl);
            }
            else if (member is FunctionDefinition func)
            {
                if (func.Name.Name == NameFactory.PropertyGetter)
                {
                    this.getters.Add(func);
                }
                else if (func.Name.Name == NameFactory.PropertySetter)
                {
                    this.setters.Add(func);
                }
                else
                {
                    throw new Exception();
                }
            }
            else
            {
                throw new Exception();
            }

            return(this);
        }
Пример #2
0
 public PropertyBuilder With(PropertyMemberBuilder builder)
 {
     return(With(builder, out IMember member));
 }
Пример #3
0
        public static PropertyMemberBuilder CreateIndexerSetter(Block body)
        {
            PropertyMemberBuilder builder = new PropertyMemberBuilder(MemberType.IndexSetter, body);

            return(builder);
        }