public static ISection CreateSection <T>(T buildSection, BuildPass <T> pass) where T : struct, IConvertible { ISection returnValue = null; var buildSectionValue = (eBuildSectionEnumeration)(object)buildSection; switch (buildSectionValue) { case eBuildSectionEnumeration.UsingStatements: { returnValue = new SectionEmpty <T>(pass); break; } case eBuildSectionEnumeration.Namespace: { returnValue = new SectionNamespace <T>(pass); break; } case eBuildSectionEnumeration.Enum: { returnValue = new SectionEnum <T>(pass); break; } case eBuildSectionEnumeration.Members: { returnValue = new SectionMembers <T>(pass); break; } case eBuildSectionEnumeration.EnumClose: { returnValue = new SectionEnumClose <T>(pass); break; } case eBuildSectionEnumeration.NamespaceClose: { returnValue = new SectionNamespaceClose <T>(pass); break; } } return(returnValue); }
public static ISection CreateSection <T>(T buildSection, BuildPass <T> pass) where T : struct, IConvertible { ISection returnValue = null; var buildSectionValue = (eBuildSectionContract)(object)buildSection; switch (buildSectionValue) { case eBuildSectionContract.UsingStatements: { returnValue = new SectionUsingStatements <T>(pass); break; } case eBuildSectionContract.Namespace: { returnValue = new SectionNamespace <T>(pass); break; } case eBuildSectionContract.Class: { returnValue = new SectionClass <T>(pass); break; } case eBuildSectionContract.Constructors: { returnValue = new SectionConstructors <T>(pass); break; } case eBuildSectionContract.Properties: { returnValue = new SectionProperties <T>(pass); break; } case eBuildSectionContract.PublicMethods: { returnValue = new SectionEmpty <T>(pass); break; } case eBuildSectionContract.PrivateMethods: { returnValue = new SectionEmpty <T>(pass); break; } case eBuildSectionContract.ClassClose: { returnValue = new SectionClassClose <T>(pass); break; } case eBuildSectionContract.NamespaceClose: { returnValue = new SectionNamespaceClose <T>(pass); break; } } return(returnValue); }