public static void CreateFiles(string outputDirectory, string subdirectory, bool forceOverwrite, params CSharpInterfaceDefinition[] definitions) { foreach (var definition in definitions) { var codeBuilder = new CSharpInterfaceBuilder { OutputDirectory = outputDirectory, ForceOverwrite = forceOverwrite, ObjectDefinition = definition }; codeBuilder.CreateFile(subdirectory); } }
public static void CreateFiles(string outputDirectory, string subdirectory, bool forceOverwrite, params IDotNetObjectDefinition[] definitions) { foreach (var definition in definitions) { if (definition is CSharpClassDefinition) { var codeBuilder = new CSharpClassBuilder { OutputDirectory = outputDirectory, ForceOverwrite = forceOverwrite, ObjectDefinition = definition }; codeBuilder.CreateFile(subdirectory); } else if (definition is CSharpInterfaceDefinition) { var codeBuilder = new CSharpInterfaceBuilder { OutputDirectory = outputDirectory, ForceOverwrite = forceOverwrite, ObjectDefinition = definition }; codeBuilder.CreateFile(subdirectory); } else if (definition is CSharpEnumDefinition) { var codeBuilder = new CSharpEnumBuilder { OutputDirectory = outputDirectory, ForceOverwrite = forceOverwrite, ObjectDefinition = definition }; codeBuilder.CreateFile(subdirectory); } else { throw new NotImplementedException(); } } }
public static void AddAttributes(this CSharpInterfaceBuilder interfaceBuilder, int start) { AddAttributes(interfaceBuilder, interfaceBuilder.InterfaceDefinition.Attributes, start); }