internal void GenerateCode(TextWriter writer) { writer.WriteLine("namespace " + generalData.Namespace + " {"); writer.WriteLine("public partial class " + generalData.ClassName + " {"); writeLoadThisMethod(writer); generalData.ReadPageStateVariablesFromCodeAndWriteTypedPageStateMethods(writer); writer.WriteLine("}"); writer.WriteLine("}"); }
internal void GenerateCode(TextWriter writer) { writer.WriteLine("namespace " + generalData.Namespace + " {"); writer.WriteLine("public partial class " + generalData.ClassName + " {"); writeInfoClass(writer); OptionalParameterPackageStatics.WriteClassIfNecessary(writer, optionalParameters); ParametersModificationStatics.WriteClassIfNecessary(writer, requiredParameters.Concat(optionalParameters)); if (entitySetup != null) { writer.WriteLine("private EntitySetup es;"); } writer.WriteLine("private Info info;"); if (requiredParameters.Any() || optionalParameters.Any()) { writer.WriteLine("private ParametersModification parametersModification;"); } writer.WriteLine("public override EntitySetupBase EsAsBaseType { get { return " + (entitySetup != null ? "es" : "null") + "; } }"); writer.WriteLine("public override PageInfo InfoAsBaseType { get { return info; } }"); writer.WriteLine( "public override ParametersModificationBase ParametersModificationAsBaseType { get { return " + (requiredParameters.Any() || optionalParameters.Any() ? "parametersModification" : "null") + "; } }"); writeInitEntitySetupMethod(writer); WebMetaLogicStatics.WriteClearInfoMethod(writer, "protected override void "); WebMetaLogicStatics.WriteCreateInfoFromQueryStringMethod( writer, requiredParameters, optionalParameters, "protected override void ", entitySetup != null ? "es.info" : ""); writeGetInfoMethod(writer); generalData.ReadPageStateVariablesFromCodeAndWriteTypedPageStateMethods(writer); WebMetaLogicStatics.WriteCreateInfoFromNewParameterValuesMethod( writer, requiredParameters, optionalParameters, "protected override PageInfo ", entitySetup != null ? "es.CreateInfoFromNewParameterValues()" : ""); writer.WriteLine("}"); writer.WriteLine("}"); }