Пример #1
0
        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("}");
        }
Пример #2
0
 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));
     writer.WriteLine("internal Info info { get; private set; }");
     if (requiredParameters.Any() || optionalParameters.Any())
     {
         writer.WriteLine("internal ParametersModification parametersModification;");
     }
     writer.WriteLine("EntitySetupInfo EntitySetupBase.InfoAsBaseType { get { return info; } }");
     writer.WriteLine(
         "ParametersModificationBase EntitySetupBase.ParametersModificationAsBaseType { get { return " +
         (requiredParameters.Any() || optionalParameters.Any() ? "parametersModification" : "null") + "; } }");
     WebMetaLogicStatics.WriteClearInfoMethod(writer, "void EntitySetupBase.");
     WebMetaLogicStatics.WriteCreateInfoFromQueryStringMethod(writer, requiredParameters, optionalParameters, "void EntitySetupBase.", "");
     WebMetaLogicStatics.WriteCreateInfoFromNewParameterValuesMethod(writer, requiredParameters, optionalParameters, "internal Info ", "");
     writer.WriteLine("}");
     writer.WriteLine("}");
 }