Exemple #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));
        }
Exemple #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);
        }
Exemple #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;
        }