Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update manually generated reference for RenderTreeFrame #13522

Merged
merged 1 commit into from
Aug 29, 2019
Merged
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
@@ -1,47 +1,58 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Runtime.InteropServices;
using Microsoft.AspNetCore.Components.Rendering;

namespace Microsoft.AspNetCore.Components.RenderTree
{
// https://github.com/dotnet/arcade/pull/2033
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Explicit)]
[StructLayout(LayoutKind.Explicit, Pack = 4)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the changes here to make this more like the authoritative source code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the source code as is and stripped it to the public API surface. Maintaining the code-generated format seems needlessly onerous.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed 100% 💯

public readonly partial struct RenderTreeFrame
{
[System.Runtime.InteropServices.FieldOffsetAttribute(8)]
public readonly int AttributeEventHandlerId;
[System.Runtime.InteropServices.FieldOffsetAttribute(16)]
public readonly string AttributeName;
[System.Runtime.InteropServices.FieldOffsetAttribute(24)]
public readonly object AttributeValue;
[System.Runtime.InteropServices.FieldOffsetAttribute(12)]
public readonly int ComponentId;
[System.Runtime.InteropServices.FieldOffsetAttribute(16)]
public readonly System.Action<object> ComponentReferenceCaptureAction;
[System.Runtime.InteropServices.FieldOffsetAttribute(8)]
public readonly int ComponentReferenceCaptureParentFrameIndex;
[System.Runtime.InteropServices.FieldOffsetAttribute(8)]
public readonly int ComponentSubtreeLength;
[System.Runtime.InteropServices.FieldOffsetAttribute(16)]
public readonly System.Type ComponentType;
[System.Runtime.InteropServices.FieldOffsetAttribute(16)]
public readonly string ElementName;
[System.Runtime.InteropServices.FieldOffsetAttribute(24)]
public readonly System.Action<Microsoft.AspNetCore.Components.ElementReference> ElementReferenceCaptureAction;
[System.Runtime.InteropServices.FieldOffsetAttribute(16)]
public readonly string ElementReferenceCaptureId;
[System.Runtime.InteropServices.FieldOffsetAttribute(8)]
public readonly int ElementSubtreeLength;
[System.Runtime.InteropServices.FieldOffsetAttribute(4)]
public readonly Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrameType FrameType;
[System.Runtime.InteropServices.FieldOffsetAttribute(16)]
public readonly string MarkupContent;
[System.Runtime.InteropServices.FieldOffsetAttribute(8)]
public readonly int RegionSubtreeLength;
[System.Runtime.InteropServices.FieldOffsetAttribute(0)]
public readonly int Sequence;
[System.Runtime.InteropServices.FieldOffsetAttribute(16)]
public readonly string TextContent;
public Microsoft.AspNetCore.Components.IComponent Component { get { throw null; } }
public override string ToString() { throw null; }
[FieldOffset(0)] public readonly int Sequence;

[FieldOffset(4)] public readonly RenderTreeFrameType FrameType;

[FieldOffset(8)] public readonly int ElementSubtreeLength;

[FieldOffset(16)] public readonly string ElementName;

[FieldOffset(24)] public readonly object ElementKey;

[FieldOffset(16)] public readonly string TextContent;

[FieldOffset(8)] public readonly ulong AttributeEventHandlerId;

[FieldOffset(16)] public readonly string AttributeName;

[FieldOffset(24)] public readonly object AttributeValue;

[FieldOffset(32)] public readonly string AttributeEventUpdatesAttributeName;

[FieldOffset(8)] public readonly int ComponentSubtreeLength;

[FieldOffset(12)] public readonly int ComponentId;

[FieldOffset(16)] public readonly Type ComponentType;

[FieldOffset(32)] public readonly object ComponentKey;

public IComponent Component => null;

[FieldOffset(8)] public readonly int RegionSubtreeLength;

[FieldOffset(16)] public readonly string ElementReferenceCaptureId;

[FieldOffset(24)] public readonly Action<ElementReference> ElementReferenceCaptureAction;

[FieldOffset(8)] public readonly int ComponentReferenceCaptureParentFrameIndex;

[FieldOffset(16)] public readonly Action<object> ComponentReferenceCaptureAction;

[FieldOffset(16)] public readonly string MarkupContent;

public override string ToString() => null;
}
}