private void writeInfoCloneAndReplaceDefaultsIfPossibleMethod(TextWriter writer)
 {
     writer.WriteLine("protected override ResourceInfo CloneAndReplaceDefaultsIfPossible( bool disableReplacementOfDefaults ) {");
     if (optionalParameters.Any())
     {
         writer.WriteLine("var parametersModification = Instance.ParametersModificationAsBaseType as ParametersModification;");
         writer.WriteLine("if( parametersModification != null && !disableReplacementOfDefaults )");
         writer.WriteLine(
             "return new Info( " +
             StringTools.ConcatenateWithDelimiter(
                 ", ",
                 entitySetup != null ? "esInfo.CloneAndReplaceDefaultsIfPossible( disableReplacementOfDefaults )" : "",
                 InfoStatics.GetInfoConstructorArguments(
                     requiredParameters,
                     optionalParameters,
                     parameter => parameter.FieldName,
                     parameter => InfoStatics.GetWasSpecifiedFieldName(parameter) + " ? " + parameter.FieldName + " : parametersModification." + parameter.PropertyName),
                 "uriFragmentIdentifier: uriFragmentIdentifier") + " );");
     }
     writer.WriteLine(
         "return new Info( " +
         StringTools.ConcatenateWithDelimiter(
             ", ",
             entitySetup != null ? "esInfo.CloneAndReplaceDefaultsIfPossible( disableReplacementOfDefaults )" : "",
             InfoStatics.GetInfoConstructorArguments(requiredParameters, optionalParameters, parameter => parameter.FieldName, parameter => parameter.FieldName),
             "uriFragmentIdentifier: uriFragmentIdentifier") + " );");
     writer.WriteLine("}");
 }
Exemple #2
0
 private void writeInfoCloneAndReplaceDefaultsIfPossibleMethod(TextWriter writer)
 {
     writer.WriteLine("internal Info CloneAndReplaceDefaultsIfPossible( bool disableReplacementOfDefaults ) {");
     if (optionalParameters.Any())
     {
         writer.WriteLine(
             "var parametersModification = ( EwfPage.Instance.EsAsBaseType != null ? EwfPage.Instance.EsAsBaseType.ParametersModificationAsBaseType : null ) as ParametersModification;");
         writer.WriteLine("if( parametersModification != null && !disableReplacementOfDefaults )");
         writer.WriteLine(
             "return new Info( " +
             InfoStatics.GetInfoConstructorArguments(
                 requiredParameters,
                 optionalParameters,
                 parameter => parameter.FieldName,
                 parameter => InfoStatics.GetWasSpecifiedFieldName(parameter) + " ? " + parameter.FieldName + " : parametersModification." + parameter.PropertyName) +
             " );");
     }
     writer.WriteLine(
         "return new Info( " +
         InfoStatics.GetInfoConstructorArguments(requiredParameters, optionalParameters, parameter => parameter.FieldName, parameter => parameter.FieldName) +
         " );");
     writer.WriteLine("}");
 }