public CSInterface(CSVisibility vis, CSIdentifier name, IEnumerable <CSMethod> methods = null) { Visibility = vis; Name = Exceptions.ThrowOnNull(name, "name"); Inheritance = new CSInheritance(); Methods = new List <CSMethod> (); Properties = new List <CSProperty> (); GenericParams = new CSGenericTypeDeclarationCollection(); GenericConstraints = new CSGenericConstraintCollection(); if (methods != null) { Methods.AddRange(methods); } }
public CSClass(CSVisibility vis, CSIdentifier name, IEnumerable <CSMethod> methods = null, bool isStatic = false, bool isSealed = false) { Visibility = vis; IsStatic = isStatic; IsSealed = isSealed; Name = Exceptions.ThrowOnNull(name, "name"); Inheritance = new CSInheritance(); Delegates = new List <CSDelegateTypeDecl> (); Fields = new List <ICodeElement> (); Constructors = new List <CSMethod> (); Methods = new List <CSMethod> (); Properties = new List <CSProperty> (); InnerClasses = new CSClasses(); InnerEnums = new List <CSEnum> (); StaticConstructor = new CSCodeBlock(); GenericParams = new CSGenericTypeDeclarationCollection(); GenericConstraints = new CSGenericConstraintCollection(); if (methods != null) { Methods.AddRange(methods); } }