Exemplo n.º 1
0
        public PropertyModel(InterfaceModel @interface, string name, TypeModel type)
        {
            Guard.ArgumentNotNullOrEmpty(() => name);
            Guard.ArgumentNotNull(() => type);

            Name   = name;
            Getter = new MethodModel(@interface, $"Get{name}").WithReturnType(type).MakePublic();
            Setter = new MethodModel(@interface, $"Set{name}").WithParameters(new MethodParameter("value", type));
        }
Exemplo n.º 2
0
        public InterfaceModel AddInterface(string name)
        {
            var i = Interfaces.FirstOrDefault(i => i.Name == name);

            if (i == null)
            {
                i = new InterfaceModel(this, name);
                Types.Add(i);
            }
            return(i);
        }
Exemplo n.º 3
0
        public MethodModel(InterfaceModel @interface, string name)
        {
            Guard.ArgumentNotNull(() => @interface);
            Guard.ArgumentNotNullOrEmpty(() => name);

            Interface     = @interface;
            Name          = name;
            Parameters    = new List <MethodParameter>();
            Attributes    = new List <InterfaceModel>();
            UsedTypes     = new List <TypeModel>();
            Accessability = Accessibility.NotApplicable;
        }