Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ private MethodProvider BuildXmlModelWriteCoreMethod()
{
MethodSignatureModifiers modifiers = _isStruct
? MethodSignatureModifiers.Private
: MethodSignatureModifiers.Protected | MethodSignatureModifiers.Virtual;
: MethodSignatureModifiers.Internal | MethodSignatureModifiers.Virtual;
if (_shouldOverrideMethods)
{
modifiers = MethodSignatureModifiers.Protected | MethodSignatureModifiers.Override;
modifiers = MethodSignatureModifiers.Internal | MethodSignatureModifiers.Override;
}

// void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Sample
{
public partial class Model
{
protected virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.Model>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Sample
{
public partial class MockInputModel
{
protected virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.MockInputModel>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Sample
{
public partial class MockInputModel
{
protected virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.MockInputModel>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private void WriteXml(global::System.Xml.XmlWriter writer, global::System.Client
}
}

protected virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.MockInputModel>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Sample
{
public partial class MockInputModel
{
protected virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.MockInputModel>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private void WriteXml(global::System.Xml.XmlWriter writer, global::System.Client
}
}

protected virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.Pet>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private void WriteXml(global::System.Xml.XmlWriter writer, global::System.Client
}
}

protected override void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal override void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.Cat>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private void WriteXml(global::System.Xml.XmlWriter writer, global::System.Client
}
}

protected virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.TestXmlModel>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private void WriteXml(global::System.Xml.XmlWriter writer, global::System.Client
}
}

protected virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.TestXmlModel>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private void WriteXml(global::System.Xml.XmlWriter writer, global::System.Client
}
}

protected virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.TestXmlModel>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void WriteXml(global::System.Xml.XmlWriter writer, global::System.Client
}
}

protected virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.TestXmlModel>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void WriteXml(global::System.Xml.XmlWriter writer, global::System.Client
}
}

protected virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.TestXmlModel>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void WriteXml(global::System.Xml.XmlWriter writer, global::System.Client
}
}

protected virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.TestXmlModel>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void WriteXml(global::System.Xml.XmlWriter writer, global::System.Client
}
}

protected virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.OuterModel>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void WriteXml(global::System.Xml.XmlWriter writer, global::System.Client
}
}

protected virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.TestXmlModel>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void WriteXml(global::System.Xml.XmlWriter writer, global::System.Client
}
}

protected virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(global::System.Xml.XmlWriter writer, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
{
string format = (options.Format == "W") ? ((global::System.ClientModel.Primitives.IPersistableModel<global::Sample.Models.TestXmlModel>)this).GetFormatFromOptions(options) : options.Format;
if ((format != "X"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void XmlSerializationMethodIsGeneratedForXmlModel()
Assert.AreEqual("XmlModelWriteCore", xmlSerializationMethod!.Signature.Name);
Assert.AreEqual(2, xmlSerializationMethod.Signature.Parameters.Count);
Assert.AreEqual(typeof(XmlWriter), xmlSerializationMethod.Signature.Parameters[0].Type.FrameworkType);
Assert.IsTrue(xmlSerializationMethod.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Protected));
Assert.IsTrue(xmlSerializationMethod.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Internal));
Assert.IsTrue(xmlSerializationMethod.Signature.Modifiers.HasFlag(MethodSignatureModifiers.Virtual));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private void WriteXml(XmlWriter writer, ModelReaderWriterOptions options, string

/// <param name="writer"> The XML writer. </param>
/// <param name="options"> The client options for reading and writing models. </param>
protected virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options)
{
string format = options.Format == "W" ? ((IPersistableModel<Plant>)this).GetFormatFromOptions(options) : options.Format;
if (format != "X")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private void WriteXml(XmlWriter writer, ModelReaderWriterOptions options, string

/// <param name="writer"> The XML writer. </param>
/// <param name="options"> The client options for reading and writing models. </param>
protected override void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options)
internal override void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options)
{
string format = options.Format == "W" ? ((IPersistableModel<Tree>)this).GetFormatFromOptions(options) : options.Format;
if (format != "X")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private void WriteXml(XmlWriter writer, ModelReaderWriterOptions options, string

/// <param name="writer"> The XML writer. </param>
/// <param name="options"> The client options for reading and writing models. </param>
protected override void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options)
internal override void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options)
{
string format = options.Format == "W" ? ((IPersistableModel<Plant>)this).GetFormatFromOptions(options) : options.Format;
if (format != "X")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private void WriteXml(XmlWriter writer, ModelReaderWriterOptions options, string

/// <param name="writer"> The XML writer. </param>
/// <param name="options"> The client options for reading and writing models. </param>
protected virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options)
{
string format = options.Format == "W" ? ((IPersistableModel<XmlAdvancedModel>)this).GetFormatFromOptions(options) : options.Format;
if (format != "X")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private void WriteXml(XmlWriter writer, ModelReaderWriterOptions options, string

/// <param name="writer"> The XML writer. </param>
/// <param name="options"> The client options for reading and writing models. </param>
protected virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options)
{
string format = options.Format == "W" ? ((IPersistableModel<XmlItem>)this).GetFormatFromOptions(options) : options.Format;
if (format != "X")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private void WriteXml(XmlWriter writer, ModelReaderWriterOptions options, string

/// <param name="writer"> The XML writer. </param>
/// <param name="options"> The client options for reading and writing models. </param>
protected virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options)
{
string format = options.Format == "W" ? ((IPersistableModel<XmlModelWithNamespace>)this).GetFormatFromOptions(options) : options.Format;
if (format != "X")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private void WriteXml(XmlWriter writer, ModelReaderWriterOptions options, string

/// <param name="writer"> The XML writer. </param>
/// <param name="options"> The client options for reading and writing models. </param>
protected virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options)
internal virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options)
{
string format = options.Format == "W" ? ((IPersistableModel<XmlNestedModel>)this).GetFormatFromOptions(options) : options.Format;
if (format != "X")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using System;
using System.ClientModel.Primitives;
using System.Xml;

namespace Payload.Pageable
{
Expand All @@ -21,7 +20,5 @@ public partial class XmlPet : IPersistableModel<XmlPet>
XmlPet IPersistableModel<XmlPet>.Create(BinaryData data, ModelReaderWriterOptions options) => throw null;

string IPersistableModel<XmlPet>.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null;

protected virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options) => throw null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Xml;

namespace Payload.Xml
{
Expand All @@ -26,7 +25,5 @@ public partial class ModelWithArrayOfModel : IPersistableModel<ModelWithArrayOfM
public static implicit operator BinaryContent(ModelWithArrayOfModel modelWithArrayOfModel) => throw null;

public static explicit operator ModelWithArrayOfModel(ClientResult result) => throw null;

protected virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options) => throw null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Xml;

namespace Payload.Xml
{
Expand All @@ -26,7 +25,5 @@ public partial class ModelWithAttributes : IPersistableModel<ModelWithAttributes
public static implicit operator BinaryContent(ModelWithAttributes modelWithAttributes) => throw null;

public static explicit operator ModelWithAttributes(ClientResult result) => throw null;

protected virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options) => throw null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Xml;

namespace Payload.Xml
{
Expand All @@ -26,7 +25,5 @@ public partial class ModelWithDictionary : IPersistableModel<ModelWithDictionary
public static implicit operator BinaryContent(ModelWithDictionary modelWithDictionary) => throw null;

public static explicit operator ModelWithDictionary(ClientResult result) => throw null;

protected virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options) => throw null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Xml;

namespace Payload.Xml
{
Expand All @@ -26,7 +25,5 @@ public partial class ModelWithEmptyArray : IPersistableModel<ModelWithEmptyArray
public static implicit operator BinaryContent(ModelWithEmptyArray modelWithEmptyArray) => throw null;

public static explicit operator ModelWithEmptyArray(ClientResult result) => throw null;

protected virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options) => throw null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Xml;

namespace Payload.Xml
{
Expand All @@ -26,7 +25,5 @@ public partial class ModelWithEncodedNames : IPersistableModel<ModelWithEncodedN
public static implicit operator BinaryContent(ModelWithEncodedNames modelWithEncodedNames) => throw null;

public static explicit operator ModelWithEncodedNames(ClientResult result) => throw null;

protected virtual void XmlModelWriteCore(XmlWriter writer, ModelReaderWriterOptions options) => throw null;
}
}
Loading
Loading