File: _generated\62\TestPlatformJsonContext.TestProcessStartInfo.g.cs
Web Access
Project: src\vstest\src\Microsoft.TestPlatform.CommunicationUtilities\Microsoft.TestPlatform.CommunicationUtilities.csproj (Microsoft.TestPlatform.CommunicationUtilities)
// <auto-generated/>

#nullable enable annotations
#nullable disable warnings

// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618

namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities
{
    internal partial class TestPlatformJsonContext
    {
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo>? _TestProcessStartInfo;
        
        /// <summary>
        /// Defines the source generated JSON serialization contract metadata for a given type.
        /// </summary>
        #nullable disable annotations // Marking the property type as nullable-oblivious.
        public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo> TestProcessStartInfo
        #nullable enable annotations
        {
            get => _TestProcessStartInfo ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo>)Options.GetTypeInfo(typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo));
        }
        
        private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo> Create_TestProcessStartInfo(global::System.Text.Json.JsonSerializerOptions options)
        {
            if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo> jsonTypeInfo))
            {
                var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo>
                {
                    ObjectCreator = () => new global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo(),
                    ObjectWithParameterizedConstructorCreator = null,
                    PropertyMetadataInitializer = _ => TestProcessStartInfoPropInit(options),
                    ConstructorParameterMetadataInitializer = null,
                    ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null),
                    SerializeHandler = TestProcessStartInfoSerializeHandler,
                    PolymorphismOptions = new global::System.Text.Json.Serialization.Metadata.JsonPolymorphismOptions(),
                    TypeClassifierFactory = null,
                };
                
                jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo>(options, objectInfo);
                jsonTypeInfo.NumberHandling = null;
            }
        
            jsonTypeInfo.OriginatingResolver = this;
            return jsonTypeInfo;
        }

        private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] TestProcessStartInfoPropInit(global::System.Text.Json.JsonSerializerOptions options)
        {
            var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[5];

            var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo),
                Converter = null,
                Getter = static obj => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo)obj).FileName,
                Setter = static (obj, value) => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo)obj).FileName = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "FileName",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo).GetProperty("FileName", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info0);

            var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo),
                Converter = null,
                Getter = static obj => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo)obj).Arguments,
                Setter = static (obj, value) => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo)obj).Arguments = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "Arguments",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo).GetProperty("Arguments", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info1);

            var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo),
                Converter = null,
                Getter = static obj => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo)obj).WorkingDirectory,
                Setter = static (obj, value) => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo)obj).WorkingDirectory = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "WorkingDirectory",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo).GetProperty("WorkingDirectory", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info2);

            var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.IDictionary<string, string>>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo),
                Converter = null,
                Getter = static obj => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo)obj).EnvironmentVariables,
                Setter = static (obj, value) => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo)obj).EnvironmentVariables = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "EnvironmentVariables",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo).GetProperty("EnvironmentVariables", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IDictionary<string, string>), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.IDictionary<string, string>>(options, info3);

            var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.IDictionary<string, string>>
            {
                IsProperty = true,
                IsPublic = true,
                IsVirtual = false,
                DeclaringType = typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo),
                Converter = null,
                Getter = static obj => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo)obj).CustomProperties,
                Setter = static (obj, value) => ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo)obj).CustomProperties = value!,
                IgnoreCondition = null,
                HasJsonInclude = false,
                IsExtensionData = false,
                NumberHandling = null,
                PropertyName = "CustomProperties",
                JsonPropertyName = null,
                AttributeProviderFactory = static () => typeof(global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo).GetProperty("CustomProperties", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IDictionary<string, string>), global::System.Array.Empty<global::System.Type>(), null),
            };
            
            properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.IDictionary<string, string>>(options, info4);

            return properties;
        }

        // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
        // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
        private void TestProcessStartInfoSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo? value)
        {
            if (value is null)
            {
                writer.WriteNullValue();
                return;
            }
            
            writer.WriteStartObject();

            writer.WriteString(PropName_FileName, ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo)value).FileName);
            writer.WriteString(PropName_Arguments, ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo)value).Arguments);
            writer.WriteString(PropName_WorkingDirectory, ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo)value).WorkingDirectory);
            writer.WritePropertyName(PropName_EnvironmentVariables);
            IDictionaryStringStringSerializeHandler(writer, ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo)value).EnvironmentVariables);
            writer.WritePropertyName(PropName_CustomProperties);
            IDictionaryStringStringSerializeHandler(writer, ((global::Microsoft.VisualStudio.TestPlatform.ObjectModel.TestProcessStartInfo)value).CustomProperties);

            writer.WriteEndObject();
        }
    }
}