From 2c6e1dacacc56da9c76806debc188fccfe5bbfbd Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Sat, 29 Jun 2019 17:48:30 -0700 Subject: [PATCH] Use ref-assembly code in shim Updates our Components shim to use the ref assembly code. This is just cleanup and will help us keep up-to-date with API review changes since we can just copy-past the files. I made two modifications to make this simple. - Removed our built-in components - Removed the HTTP stuff This makes it easier for us to maintain the shim. You can see cases where I had to update tests because they diverged from what the real APIs look like (no product bugs). I'd still like to improve this workflow so suggestions wanted xD \n\nCommit migrated from https://github.com/dotnet/aspnetcore-tooling/commit/8517be2bacafb8b06f8ba4d53a08c145f038ad27 --- .../test/AssertFrame.cs | 139 --- .../ComponentCodeGenerationTestBase.cs | 10 +- .../ComponentDeclarationIntegrationTest.cs | 6 +- .../ComponentDirectiveIntegrationTest.cs | 8 +- .../BindTagHelperDescriptorProviderTest.cs | 24 +- ...omponentTagHelperDescriptorProviderTest.cs | 16 +- .../Components/RenderTreeFrame.cs | 344 ------- .../Components/RenderTreeFrameType.cs | 54 -- ...etCore.Components.netstandard2.0.Manual.cs | 47 + ...ft.AspNetCore.Components.netstandard2.0.cs | 841 ++++++++++++++++++ .../BindAttributes.cs | 30 - .../BindElementAttribute.cs | 64 -- .../BindInputElementAttribute.cs | 59 -- .../BindMethods.cs | 247 ----- .../ComponentBase.cs | 27 - .../ElementRef.cs | 12 - .../EventCallback.cs | 33 - .../EventCallbackFactory.cs | 43 - .../EventCallbackFactoryBinderExtensions.cs | 107 --- ...entCallbackFactoryUIEventArgsExtensions.cs | 59 -- .../EventHandlerAttribute.cs | 45 - .../EventHandlers.cs | 128 --- .../IComponent.cs | 13 - .../IHandleEvent.cs | 9 - .../InjectAttribute.cs | 16 - .../Layouts/LayoutAttribute.cs | 21 - .../MarkupString.cs | 36 - .../ParameterAttribute.cs | 15 - .../ParameterCollection.cs | 13 - .../RenderFrame.cs | 22 - .../RenderHandle.cs | 12 - .../RenderTree/RenderTreeBuilder.cs | 119 --- .../RouteAttribute.cs | 33 - .../RuntimeHelpers.cs | 20 - .../UIEventArgs.cs | 518 ----------- .../UIEventArgsRenderTreeBuilderExtensions.cs | 547 ------------ 36 files changed, 929 insertions(+), 2808 deletions(-) delete mode 100644 src/Razor/Microsoft.AspNetCore.Razor.Language/test/AssertFrame.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Components/RenderTreeFrame.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Components/RenderTreeFrameType.cs create mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs create mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindAttributes.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindElementAttribute.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindInputElementAttribute.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindMethods.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ComponentBase.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ElementRef.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallback.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallbackFactory.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallbackFactoryBinderExtensions.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallbackFactoryUIEventArgsExtensions.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventHandlerAttribute.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventHandlers.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/IComponent.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/IHandleEvent.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/InjectAttribute.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/Layouts/LayoutAttribute.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/MarkupString.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ParameterAttribute.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ParameterCollection.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RenderFrame.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RenderHandle.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RenderTree/RenderTreeBuilder.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RouteAttribute.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RuntimeHelpers.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/UIEventArgs.cs delete mode 100644 src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/UIEventArgsRenderTreeBuilderExtensions.cs diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/AssertFrame.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/AssertFrame.cs deleted file mode 100644 index a03c4db92e..0000000000 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/AssertFrame.cs +++ /dev/null @@ -1,139 +0,0 @@ -// 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 Microsoft.AspNetCore.Components.RenderTree; -using Xunit; - -namespace Microsoft.AspNetCore.Components -{ - internal static class AssertFrame - { - public static void Sequence(RenderTreeFrame frame, int? sequence = null) - { - if (sequence.HasValue) - { - Assert.Equal(sequence.Value, frame.Sequence); - } - } - - public static void Text(RenderTreeFrame frame, string textContent, int? sequence = null) - { - Assert.Equal(RenderTreeFrameType.Text, frame.FrameType); - Assert.Equal(textContent, frame.TextContent); - Assert.Equal(0, frame.ElementSubtreeLength); - AssertFrame.Sequence(frame, sequence); - } - - internal static void Markup(RenderTreeFrame frame, string markupContent, int? sequence = null) - { - Assert.Equal(RenderTreeFrameType.Markup, frame.FrameType); - Assert.Equal(markupContent, frame.MarkupContent); - Assert.Equal(0, frame.ElementSubtreeLength); - AssertFrame.Sequence(frame, sequence); - } - - public static void Element(RenderTreeFrame frame, string elementName, int subtreeLength, int? sequence = null) - { - Assert.Equal(RenderTreeFrameType.Element, frame.FrameType); - Assert.Equal(elementName, frame.ElementName); - Assert.Equal(subtreeLength, frame.ElementSubtreeLength); - AssertFrame.Sequence(frame, sequence); - } - - public static void Attribute(RenderTreeFrame frame, string attributeName, int? sequence = null) - { - Assert.Equal(RenderTreeFrameType.Attribute, frame.FrameType); - Assert.Equal(attributeName, frame.AttributeName); - AssertFrame.Sequence(frame, sequence); - } - - public static void Attribute(RenderTreeFrame frame, string attributeName, string attributeValue, int? sequence = null) - { - AssertFrame.Attribute(frame, attributeName, sequence); - Assert.Equal(attributeValue, frame.AttributeValue); - } - - public static void Attribute(RenderTreeFrame frame, string attributeName, Action attributeEventHandlerValue, int? sequence = null) - { - AssertFrame.Attribute(frame, attributeName, sequence); - Assert.Equal(attributeEventHandlerValue, frame.AttributeValue); - } - - public static void Attribute(RenderTreeFrame frame, string attributeName, object attributeValue, int? sequence = null) - { - AssertFrame.Attribute(frame, attributeName, sequence); - Assert.Equal(attributeValue, frame.AttributeValue); - } - - public static void Attribute(RenderTreeFrame frame, string attributeName, Type valueType, int? sequence = null) - { - AssertFrame.Attribute(frame, attributeName, sequence); - Assert.IsType(valueType, frame.AttributeValue); - } - - public static void Attribute(RenderTreeFrame frame, string attributeName, Action attributeValidator, int? sequence = null) - { - AssertFrame.Attribute(frame, attributeName, sequence); - attributeValidator(frame.AttributeValue); - } - - public static void Component(RenderTreeFrame frame, int? subtreeLength = null, int? sequence = null) where T : IComponent - { - Component(frame, typeof(T).FullName, subtreeLength, sequence); - } - - public static void Component(RenderTreeFrame frame, string typeName, int? subtreeLength = null, int? sequence = null) - { - Assert.Equal(RenderTreeFrameType.Component, frame.FrameType); - Assert.Equal(typeName, frame.ComponentType.FullName); - if (subtreeLength.HasValue) - { - Assert.Equal(subtreeLength.Value, frame.ComponentSubtreeLength); - } - AssertFrame.Sequence(frame, sequence); - } - - public static void ComponentWithInstance(RenderTreeFrame frame, int componentId, int? subtreeLength = null, int? sequence = null) where T : IComponent - { - AssertFrame.Component(frame, subtreeLength, sequence); - Assert.IsType(frame.Component); - Assert.Equal(componentId, frame.ComponentId); - } - - public static void Region(RenderTreeFrame frame, int subtreeLength, int? sequence = null) - { - Assert.Equal(RenderTreeFrameType.Region, frame.FrameType); - Assert.Equal(subtreeLength, frame.RegionSubtreeLength); - AssertFrame.Sequence(frame, sequence); - } - - public static void Whitespace(RenderTreeFrame frame, int? sequence = null) - { - Assert.Equal(RenderTreeFrameType.Text, frame.FrameType); - AssertFrame.Sequence(frame, sequence); - Assert.True(string.IsNullOrWhiteSpace(frame.TextContent)); - } - - public static void ElementReferenceCapture(RenderTreeFrame frame, Action action, int? sequence = null) - { - Assert.Equal(RenderTreeFrameType.ElementReferenceCapture, frame.FrameType); - Assert.Same(action, frame.ElementReferenceCaptureAction); - AssertFrame.Sequence(frame, sequence); - } - - public static void ComponentReferenceCapture(RenderTreeFrame frame, int? sequence = null) - { - Assert.Equal(RenderTreeFrameType.ComponentReferenceCapture, frame.FrameType); - Assert.NotNull(frame.ComponentReferenceCaptureAction); - AssertFrame.Sequence(frame, sequence); - } - - public static void ComponentReferenceCapture(RenderTreeFrame frame, Action action, int? sequence = null) - { - Assert.Equal(RenderTreeFrameType.ComponentReferenceCapture, frame.FrameType); - Assert.Same(action, frame.ComponentReferenceCaptureAction); - AssertFrame.Sequence(frame, sequence); - } - } -} diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs index a0f7aea1c4..69874ce9c5 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs @@ -603,11 +603,8 @@ using Microsoft.AspNetCore.Components; namespace Test { - public class MyComponent : ComponentBase, IComponent + public class MyComponent : ComponentBase { - void IComponent.SetParameters(ParameterCollection parameters) - { - } } }")); @@ -666,11 +663,8 @@ using Microsoft.AspNetCore.Components; namespace Test { - public class MyComponent : ComponentBase, IComponent + public class MyComponent : ComponentBase { - void IComponent.SetParameters(ParameterCollection parameters) - { - } } }")); diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs index 0ac00af80f..25ec85093b 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDeclarationIntegrationTest.cs @@ -3,6 +3,7 @@ using System.Reflection; using System.Text; +using System.Threading.Tasks; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.RenderTree; using Microsoft.CodeAnalysis; @@ -155,7 +156,7 @@ namespace Test public class BaseClass : IComponent { - public void Init(RenderHandle renderHandle) + public void Configure(RenderHandle renderHandle) { } @@ -163,8 +164,9 @@ namespace Test { } - public void SetParameters(ParameterCollection parameters) + public Task SetParametersAsync(ParameterCollection parameters) { + throw new System.NotImplementedException(); } } diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDirectiveIntegrationTest.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDirectiveIntegrationTest.cs index 4e5fe27b4c..6c6ab30a52 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDirectiveIntegrationTest.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentDirectiveIntegrationTest.cs @@ -4,6 +4,7 @@ using System; using System.Linq; using System.Reflection; +using System.Threading.Tasks; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Layouts; using Microsoft.CodeAnalysis; @@ -47,7 +48,6 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests // Assert var layoutAttribute = component.GetType().GetCustomAttribute(); Assert.NotNull(layoutAttribute); - Assert.Equal(typeof(TestLayout), layoutAttribute.LayoutType); } [Fact] @@ -127,12 +127,14 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests [Parameter] RenderFragment Body { get; set; } - public void Init(RenderHandle renderHandle) + public void Configure(RenderHandle renderHandle) { + throw new NotImplementedException(); } - public void SetParameters(ParameterCollection parameters) + public Task SetParametersAsync(ParameterCollection parameters) { + throw new NotImplementedException(); } } diff --git a/src/Razor/Microsoft.CodeAnalysis.Razor/test/BindTagHelperDescriptorProviderTest.cs b/src/Razor/Microsoft.CodeAnalysis.Razor/test/BindTagHelperDescriptorProviderTest.cs index eb868d3e4a..328808dd40 100644 --- a/src/Razor/Microsoft.CodeAnalysis.Razor/test/BindTagHelperDescriptorProviderTest.cs +++ b/src/Razor/Microsoft.CodeAnalysis.Razor/test/BindTagHelperDescriptorProviderTest.cs @@ -17,15 +17,19 @@ namespace Microsoft.CodeAnalysis.Razor var compilation = BaseCompilation.AddSyntaxTrees(Parse(@" using System; using System.Linq.Expressions; +using System.Threading.Tasks; using Microsoft.AspNetCore.Components; namespace Test { public class MyComponent : IComponent { - public void Init(RenderHandle renderHandle) { } + public void Configure(RenderHandle renderHandle) { } - public void SetParameters(ParameterCollection parameters) { } + public Task SetParametersAsync(ParameterCollection parameters) + { + return Task.CompletedTask; + } [Parameter] string MyProperty { get; set; } @@ -137,15 +141,19 @@ namespace Test { // Arrange var compilation = BaseCompilation.AddSyntaxTrees(Parse(@" +using System.Threading.Tasks; using Microsoft.AspNetCore.Components; namespace Test { public class MyComponent : IComponent { - public void Init(RenderHandle renderHandle) { } + public void Configure(RenderHandle renderHandle) { } - public void SetParameters(ParameterCollection parameters) { } + public Task SetParametersAsync(ParameterCollection parameters) + { + return Task.CompletedTask; + } [Parameter] string MyProperty { get; set; } @@ -254,15 +262,19 @@ namespace Test // Arrange var compilation = BaseCompilation.AddSyntaxTrees(Parse(@" using System; +using System.Threading.Tasks; using Microsoft.AspNetCore.Components; namespace Test { public class MyComponent : IComponent { - public void Init(RenderHandle renderHandle) { } + public void Configure(RenderHandle renderHandle) { } - public void SetParameters(ParameterCollection parameters) { } + public Task SetParametersAsync(ParameterCollection parameters) + { + return Task.CompletedTask; + } public string MyProperty { get; set; } diff --git a/src/Razor/Microsoft.CodeAnalysis.Razor/test/ComponentTagHelperDescriptorProviderTest.cs b/src/Razor/Microsoft.CodeAnalysis.Razor/test/ComponentTagHelperDescriptorProviderTest.cs index c4df5ed23f..9c29483766 100644 --- a/src/Razor/Microsoft.CodeAnalysis.Razor/test/ComponentTagHelperDescriptorProviderTest.cs +++ b/src/Razor/Microsoft.CodeAnalysis.Razor/test/ComponentTagHelperDescriptorProviderTest.cs @@ -16,15 +16,19 @@ namespace Microsoft.CodeAnalysis.Razor // Arrange var compilation = BaseCompilation.AddSyntaxTrees(Parse(@" +using System.Threading.Tasks; using Microsoft.AspNetCore.Components; namespace Test { public class MyComponent : IComponent { - public void Init(RenderHandle renderHandle) { } + public void Configure(RenderHandle renderHandle) { } - public void SetParameters(ParameterCollection parameters) { } + public Task SetParametersAsync(ParameterCollection parameters) + { + return Task.CompletedTask; + } [Parameter] private string MyProperty { get; set; } @@ -132,15 +136,19 @@ namespace Test // Arrange var compilation = BaseCompilation.AddSyntaxTrees(Parse(@" +using System.Threading.Tasks; using Microsoft.AspNetCore.Components; namespace Test { public class MyComponent : IComponent { - public void Init(RenderHandle renderHandle) { } + public void Configure(RenderHandle renderHandle) { } - public void SetParameters(ParameterCollection parameters) { } + public Task SetParametersAsync(ParameterCollection parameters) + { + return Task.CompletedTask; + } [Parameter] private string MyProperty { get; set; } diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Components/RenderTreeFrame.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Components/RenderTreeFrame.cs deleted file mode 100644 index 4441c06c9b..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Components/RenderTreeFrame.cs +++ /dev/null @@ -1,344 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Components.RenderTree -{ - /// - /// Represents an entry in a tree of user interface (UI) items. - /// - [StructLayout(LayoutKind.Explicit)] - public readonly struct RenderTreeFrame - { - // Note that the struct layout has to be valid in both 32-bit and 64-bit runtime platforms, - // which means that all reference-type fields need to take up 8 bytes (except for the last - // one, which will be sized as either 4 or 8 bytes depending on the runtime platform). - // This is not optimal for the Mono-WebAssembly case because that's always 32-bit so the - // reference-type fields could be reduced to 4 bytes each. We could use ifdefs to have - // different fields offsets for the 32 and 64 bit compile targets, but then we'd have the - // complexity of needing different binaries when loaded into Mono-WASM vs desktop. - // Eventually we might stop using this shared memory interop altogether (and would have to - // if running as a web worker) so for now to keep things simple, treat reference types as - // 8 bytes here. - - // -------------------------------------------------------------------------------- - // Common - // -------------------------------------------------------------------------------- - - /// - /// Gets the sequence number of the frame. Sequence numbers indicate the relative source - /// positions of the instructions that inserted the frames. Sequence numbers are only - /// comparable within the same sequence (typically, the same source method). - /// - [FieldOffset(0)] public readonly int Sequence; - - /// - /// Describes the type of this frame. - /// - [FieldOffset(4)] public readonly RenderTreeFrameType FrameType; - - // -------------------------------------------------------------------------------- - // RenderTreeFrameType.Element - // -------------------------------------------------------------------------------- - - /// - /// If the property equals - /// gets the number of frames in the subtree for which this frame is the root. - /// The value is zero if the frame has not yet been closed. - /// - [FieldOffset(8)] public readonly int ElementSubtreeLength; - - /// - /// If the property equals , - /// gets a name representing the type of the element. Otherwise, the value is undefined. - /// - [FieldOffset(16)] public readonly string ElementName; - - // -------------------------------------------------------------------------------- - // RenderTreeFrameType.Text - // -------------------------------------------------------------------------------- - - /// - /// If the property equals , - /// gets the content of the text frame. Otherwise, the value is undefined. - /// - [FieldOffset(16)] public readonly string TextContent; - - // -------------------------------------------------------------------------------- - // RenderTreeFrameType.Attribute - // -------------------------------------------------------------------------------- - - /// - /// If the property equals - /// gets the ID of the corresponding event handler, if any. - /// - [FieldOffset(8)] public readonly int AttributeEventHandlerId; - - /// - /// If the property equals , - /// gets the attribute name. Otherwise, the value is undefined. - /// - [FieldOffset(16)] public readonly string AttributeName; - - /// - /// If the property equals , - /// gets the attribute value. Otherwise, the value is undefined. - /// - [FieldOffset(24)] public readonly object AttributeValue; - - // -------------------------------------------------------------------------------- - // RenderTreeFrameType.Component - // -------------------------------------------------------------------------------- - - /// - /// If the property equals - /// gets the number of frames in the subtree for which this frame is the root. - /// The value is zero if the frame has not yet been closed. - /// - [FieldOffset(8)] public readonly int ComponentSubtreeLength; - - /// - /// If the property equals , - /// gets the child component instance identifier. - /// - [FieldOffset(12)] public readonly int ComponentId; - - /// - /// If the property equals , - /// gets the type of the child component. - /// - [FieldOffset(16)] public readonly Type ComponentType; - - /// - /// If the property equals , - /// gets the child component instance. Otherwise, the value is undefined. - /// - public IComponent Component => null; - - // -------------------------------------------------------------------------------- - // RenderTreeFrameType.Region - // -------------------------------------------------------------------------------- - - /// - /// If the property equals - /// gets the number of frames in the subtree for which this frame is the root. - /// The value is zero if the frame has not yet been closed. - /// - [FieldOffset(8)] public readonly int RegionSubtreeLength; - - // -------------------------------------------------------------------------------- - // RenderTreeFrameType.ElementReferenceCapture - // -------------------------------------------------------------------------------- - - /// - /// If the property equals , - /// gets the ID of the reference capture. Otherwise, the value is undefined. - /// - [FieldOffset(16)] public readonly string ElementReferenceCaptureId; - - /// - /// If the property equals , - /// gets the action that writes the reference to its target. Otherwise, the value is undefined. - /// - [FieldOffset(24)] public readonly Action ElementReferenceCaptureAction; - - // -------------------------------------------------------------------------------- - // RenderTreeFrameType.ComponentReferenceCapture - // -------------------------------------------------------------------------------- - - /// - /// If the property equals , - /// gets the index of the parent frame representing the component being captured. Otherwise, the value is undefined. - /// WARNING: This index can only be used in the context of the frame's original render tree. If the frame is - /// copied elsewhere, such as to the ReferenceFrames buffer of a RenderTreeDiff, then the index will - /// not relate to entries in that other buffer. - /// Currently there's no scenario where this matters, but if there was, we could change all of the subtree - /// initialization logic in RenderTreeDiffBuilder to walk the frames hierarchically, then it would know - /// the parent index at the point where it wants to initialize the ComponentReferenceCapture frame. - /// - [FieldOffset(8)] public readonly int ComponentReferenceCaptureParentFrameIndex; - - /// - /// If the property equals , - /// gets the action that writes the reference to its target. Otherwise, the value is undefined. - /// - [FieldOffset(16)] public readonly Action ComponentReferenceCaptureAction; - - // -------------------------------------------------------------------------------- - // RenderTreeFrameType.Markup - // -------------------------------------------------------------------------------- - - /// - /// If the property equals , - /// gets the content of the markup frame. Otherwise, the value is undefined. - /// - [FieldOffset(16)] public readonly string MarkupContent; - - private RenderTreeFrame(int sequence, string elementName, int elementSubtreeLength) - : this() - { - FrameType = RenderTreeFrameType.Element; - Sequence = sequence; - ElementName = elementName; - ElementSubtreeLength = elementSubtreeLength; - } - - private RenderTreeFrame(int sequence, Type componentType, int componentSubtreeLength) - : this() - { - FrameType = RenderTreeFrameType.Component; - Sequence = sequence; - ComponentType = componentType; - ComponentSubtreeLength = componentSubtreeLength; - } - - private RenderTreeFrame(int sequence, string textContent) - : this() - { - FrameType = RenderTreeFrameType.Text; - Sequence = sequence; - TextContent = textContent; - } - - private RenderTreeFrame(int sequence, string attributeName, object attributeValue) - : this() - { - FrameType = RenderTreeFrameType.Attribute; - Sequence = sequence; - AttributeName = attributeName; - AttributeValue = attributeValue; - } - - private RenderTreeFrame(int sequence, string attributeName, object attributeValue, int eventHandlerId) - : this() - { - FrameType = RenderTreeFrameType.Attribute; - Sequence = sequence; - AttributeName = attributeName; - AttributeValue = attributeValue; - AttributeEventHandlerId = eventHandlerId; - } - - private RenderTreeFrame(int sequence, int regionSubtreeLength) - : this() - { - FrameType = RenderTreeFrameType.Region; - Sequence = sequence; - RegionSubtreeLength = regionSubtreeLength; - } - - private RenderTreeFrame(int sequence, Action elementReferenceCaptureAction, string elementReferenceCaptureId) - : this() - { - FrameType = RenderTreeFrameType.ElementReferenceCapture; - Sequence = sequence; - ElementReferenceCaptureAction = elementReferenceCaptureAction; - ElementReferenceCaptureId = elementReferenceCaptureId; - } - - private RenderTreeFrame(int sequence, Action componentReferenceCaptureAction, int parentFrameIndex) - : this() - { - FrameType = RenderTreeFrameType.ComponentReferenceCapture; - Sequence = sequence; - ComponentReferenceCaptureAction = componentReferenceCaptureAction; - ComponentReferenceCaptureParentFrameIndex = parentFrameIndex; - } - - // If we need further constructors whose signatures clash with the patterns above, - // we can add extra args to this general-purpose one. - private RenderTreeFrame(int sequence, RenderTreeFrameType frameType, string markupContent) - : this() - { - FrameType = frameType; - Sequence = sequence; - MarkupContent = markupContent; - } - - internal static RenderTreeFrame Element(int sequence, string elementName) - => new RenderTreeFrame(sequence, elementName: elementName, elementSubtreeLength: 0); - - internal static RenderTreeFrame Text(int sequence, string textContent) - => new RenderTreeFrame(sequence, textContent: textContent); - - internal static RenderTreeFrame Markup(int sequence, string markupContent) - => new RenderTreeFrame(sequence, RenderTreeFrameType.Markup, markupContent); - - internal static RenderTreeFrame Attribute(int sequence, string name, MulticastDelegate value) - => new RenderTreeFrame(sequence, attributeName: name, attributeValue: value); - - internal static RenderTreeFrame Attribute(int sequence, string name, object value) - => new RenderTreeFrame(sequence, attributeName: name, attributeValue: value); - - internal static RenderTreeFrame ChildComponent(int sequence, Type componentType) - => new RenderTreeFrame(sequence, componentType, 0); - - internal static RenderTreeFrame PlaceholderChildComponentWithSubtreeLength(int subtreeLength) - => new RenderTreeFrame(0, typeof(IComponent), subtreeLength); - - internal static RenderTreeFrame Region(int sequence) - => new RenderTreeFrame(sequence, regionSubtreeLength: 0); - - internal static RenderTreeFrame ElementReferenceCapture(int sequence, Action elementReferenceCaptureAction) - => new RenderTreeFrame(sequence, elementReferenceCaptureAction: elementReferenceCaptureAction, elementReferenceCaptureId: null); - - internal static RenderTreeFrame ComponentReferenceCapture(int sequence, Action componentReferenceCaptureAction, int parentFrameIndex) - => new RenderTreeFrame(sequence, componentReferenceCaptureAction: componentReferenceCaptureAction, parentFrameIndex: parentFrameIndex); - - internal RenderTreeFrame WithElementSubtreeLength(int elementSubtreeLength) - => new RenderTreeFrame(Sequence, elementName: ElementName, elementSubtreeLength: elementSubtreeLength); - - internal RenderTreeFrame WithComponentSubtreeLength(int componentSubtreeLength) - => new RenderTreeFrame(Sequence, componentType: ComponentType, componentSubtreeLength: componentSubtreeLength); - - internal RenderTreeFrame WithAttributeSequence(int sequence) - => new RenderTreeFrame(sequence, attributeName: AttributeName, attributeValue: AttributeValue); - - internal RenderTreeFrame WithAttributeEventHandlerId(int eventHandlerId) - => new RenderTreeFrame(Sequence, AttributeName, AttributeValue, eventHandlerId); - - internal RenderTreeFrame WithRegionSubtreeLength(int regionSubtreeLength) - => new RenderTreeFrame(Sequence, regionSubtreeLength: regionSubtreeLength); - - internal RenderTreeFrame WithElementReferenceCaptureId(string elementReferenceCaptureId) - => new RenderTreeFrame(Sequence, ElementReferenceCaptureAction, elementReferenceCaptureId); - - /// - // Just to be nice for debugging and unit tests. - public override string ToString() - { - switch (FrameType) - { - case RenderTreeFrameType.Attribute: - return $"Attribute: (seq={Sequence}, id={AttributeEventHandlerId}) '{AttributeName}'='{AttributeValue}'"; - - case RenderTreeFrameType.Component: - return $"Component: (seq={Sequence}, len={ComponentSubtreeLength}) {ComponentType}"; - - case RenderTreeFrameType.Element: - return $"Element: (seq={Sequence}, len={ElementSubtreeLength}) {ElementName}"; - - case RenderTreeFrameType.Region: - return $"Region: (seq={Sequence}, len={RegionSubtreeLength})"; - - case RenderTreeFrameType.Text: - return $"Text: (seq={Sequence}, len=n/a) {EscapeNewlines(TextContent)}"; - - case RenderTreeFrameType.Markup: - return $"Markup: (seq={Sequence}, len=n/a) {EscapeNewlines(TextContent)}"; - - case RenderTreeFrameType.ElementReferenceCapture: - return $"ElementReferenceCapture: (seq={Sequence}, len=n/a) {ElementReferenceCaptureAction}"; - } - - return base.ToString(); - } - - private static string EscapeNewlines(string text) - { - return text.Replace("\n", "\\n").Replace("\r\n", "\\r\\n"); - } - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Components/RenderTreeFrameType.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Components/RenderTreeFrameType.cs deleted file mode 100644 index 5a64846ae9..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Components/RenderTreeFrameType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Components.RenderTree -{ - /// - /// Describes the type of a . - /// - public enum RenderTreeFrameType : int - { - /// - /// Represents a container for other frames. - /// - Element = 1, - - /// - /// Represents text content. - /// - Text = 2, - - /// - /// Represents a key-value pair associated with another . - /// - Attribute = 3, - - /// - /// Represents a child component. - /// - Component = 4, - - /// - /// Defines the boundary around range of sibling frames that should be treated as an - /// unsplittable group for the purposes of diffing. This is typically used when appending - /// a tree fragment generated by external code, because the sequence numbers in that tree - /// fragment are not comparable to sequence numbers outside it. - /// - Region = 5, - - /// - /// Represents an instruction to capture or update a reference to the parent element. - /// - ElementReferenceCapture = 6, - - /// - /// Represents an instruction to capture or update a reference to the parent component. - /// - ComponentReferenceCapture = 7, - - /// - /// Represents a block of markup content. - /// - Markup = 8, - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs new file mode 100644 index 0000000000..b83fc48298 --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.Manual.cs @@ -0,0 +1,47 @@ +// 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. + +namespace Microsoft.AspNetCore.Components.RenderTree +{ + // https://github.com/dotnet/arcade/pull/2033 + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Explicit)] + 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 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 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; } + } +} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.cs new file mode 100644 index 0000000000..92b9f1f55d --- /dev/null +++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components.netstandard2.0.cs @@ -0,0 +1,841 @@ +// 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. + +namespace Microsoft.AspNetCore.Components +{ + public partial class AuthenticationState + { + public AuthenticationState(System.Security.Claims.ClaimsPrincipal user) { } + public System.Security.Claims.ClaimsPrincipal User { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public delegate void AuthenticationStateChangedHandler(System.Threading.Tasks.Task task); + public abstract partial class AuthenticationStateProvider + { + protected AuthenticationStateProvider() { } + public event Microsoft.AspNetCore.Components.AuthenticationStateChangedHandler AuthenticationStateChanged { add { } remove { } } + public abstract System.Threading.Tasks.Task GetAuthenticationStateAsync(); + protected void NotifyAuthenticationStateChanged(System.Threading.Tasks.Task task) { } + } + [Microsoft.AspNetCore.Components.BindElementAttribute("select", null, "value", "onchange")] + [Microsoft.AspNetCore.Components.BindElementAttribute("textarea", null, "value", "onchange")] + [Microsoft.AspNetCore.Components.BindInputElementAttribute("checkbox", null, "checked", "onchange")] + [Microsoft.AspNetCore.Components.BindInputElementAttribute("text", null, "value", "onchange")] + [Microsoft.AspNetCore.Components.BindInputElementAttribute(null, "value", "value", "onchange")] + [Microsoft.AspNetCore.Components.BindInputElementAttribute(null, null, "value", "onchange")] + public static partial class BindAttributes + { + } + [System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)] + public sealed partial class BindElementAttribute : System.Attribute + { + public BindElementAttribute(string element, string suffix, string valueAttribute, string changeAttribute) { } + public string ChangeAttribute { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public string Element { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public string Suffix { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public string ValueAttribute { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + [System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)] + public sealed partial class BindInputElementAttribute : System.Attribute + { + public BindInputElementAttribute(string type, string suffix, string valueAttribute, string changeAttribute) { } + public string ChangeAttribute { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public string Suffix { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public string Type { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public string ValueAttribute { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public static partial class BindMethods + { + public static Microsoft.AspNetCore.Components.EventCallback GetEventHandlerValue(Microsoft.AspNetCore.Components.EventCallback value) where T : Microsoft.AspNetCore.Components.UIEventArgs { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback GetEventHandlerValue(Microsoft.AspNetCore.Components.EventCallback value) where T : Microsoft.AspNetCore.Components.UIEventArgs { throw null; } + public static System.MulticastDelegate GetEventHandlerValue(System.Action value) where T : Microsoft.AspNetCore.Components.UIEventArgs { throw null; } + public static System.MulticastDelegate GetEventHandlerValue(System.Action value) where T : Microsoft.AspNetCore.Components.UIEventArgs { throw null; } + public static System.MulticastDelegate GetEventHandlerValue(System.Func value) where T : Microsoft.AspNetCore.Components.UIEventArgs { throw null; } + public static System.MulticastDelegate GetEventHandlerValue(System.Func value) where T : Microsoft.AspNetCore.Components.UIEventArgs { throw null; } + public static string GetEventHandlerValue(string value) where T : Microsoft.AspNetCore.Components.UIEventArgs { throw null; } + public static string GetValue(System.DateTime value, string format) { throw null; } + public static T GetValue(T value) { throw null; } + public static System.Action SetValueHandler(System.Action setter, bool existingValue) { throw null; } + public static System.Action SetValueHandler(System.Action setter, System.DateTime existingValue) { throw null; } + public static System.Action SetValueHandler(System.Action setter, System.DateTime existingValue, string format) { throw null; } + public static System.Action SetValueHandler(System.Action setter, decimal existingValue) { throw null; } + public static System.Action SetValueHandler(System.Action setter, double existingValue) { throw null; } + public static System.Action SetValueHandler(System.Action setter, int existingValue) { throw null; } + public static System.Action SetValueHandler(System.Action setter, long existingValue) { throw null; } + public static System.Action SetValueHandler(System.Action setter, bool? existingValue) { throw null; } + public static System.Action SetValueHandler(System.Action setter, decimal? existingValue) { throw null; } + public static System.Action SetValueHandler(System.Action setter, double? existingValue) { throw null; } + public static System.Action SetValueHandler(System.Action setter, int? existingValue) { throw null; } + public static System.Action SetValueHandler(System.Action setter, long? existingValue) { throw null; } + public static System.Action SetValueHandler(System.Action setter, float? existingValue) { throw null; } + public static System.Action SetValueHandler(System.Action setter, float existingValue) { throw null; } + public static System.Action SetValueHandler(System.Action setter, string existingValue) { throw null; } + public static System.Action SetValueHandler(System.Action setter, T existingValue) { throw null; } + } + [System.AttributeUsageAttribute(System.AttributeTargets.Property, AllowMultiple=false, Inherited=false)] + public sealed partial class CascadingParameterAttribute : System.Attribute + { + public CascadingParameterAttribute() { } + public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public abstract partial class ComponentBase : Microsoft.AspNetCore.Components.IComponent, Microsoft.AspNetCore.Components.IHandleAfterRender, Microsoft.AspNetCore.Components.IHandleEvent + { + public ComponentBase() { } + protected virtual void BuildRenderTree(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder) { } + protected System.Threading.Tasks.Task Invoke(System.Action workItem) { throw null; } + protected System.Threading.Tasks.Task InvokeAsync(System.Func workItem) { throw null; } + void Microsoft.AspNetCore.Components.IComponent.Configure(Microsoft.AspNetCore.Components.RenderHandle renderHandle) { } + System.Threading.Tasks.Task Microsoft.AspNetCore.Components.IHandleAfterRender.OnAfterRenderAsync() { throw null; } + System.Threading.Tasks.Task Microsoft.AspNetCore.Components.IHandleEvent.HandleEventAsync(Microsoft.AspNetCore.Components.EventCallbackWorkItem callback, object arg) { throw null; } + protected virtual void OnAfterRender() { } + protected virtual System.Threading.Tasks.Task OnAfterRenderAsync() { throw null; } + protected virtual void OnInit() { } + protected virtual System.Threading.Tasks.Task OnInitAsync() { throw null; } + protected virtual void OnParametersSet() { } + protected virtual System.Threading.Tasks.Task OnParametersSetAsync() { throw null; } + public virtual System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterCollection parameters) { throw null; } + protected virtual bool ShouldRender() { throw null; } + protected void StateHasChanged() { } + } + public partial class DataTransfer + { + public DataTransfer() { } + public string DropEffect { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string EffectAllowed { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string[] Files { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public Microsoft.AspNetCore.Components.UIDataTransferItem[] Items { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string[] Types { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ElementRef + { + private readonly object _dummy; + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public string __internalId { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EventCallback + { + private readonly object _dummy; + public static readonly Microsoft.AspNetCore.Components.EventCallback Empty; + public static readonly Microsoft.AspNetCore.Components.EventCallbackFactory Factory; + public EventCallback(Microsoft.AspNetCore.Components.IHandleEvent receiver, System.MulticastDelegate @delegate) { throw null; } + public bool HasDelegate { get { throw null; } } + public System.Threading.Tasks.Task InvokeAsync(object arg) { throw null; } + } + public sealed partial class EventCallbackFactory + { + public EventCallbackFactory() { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, Microsoft.AspNetCore.Components.EventCallback callback) { throw null; } + public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, System.Action callback) { throw null; } + public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, System.Action callback) { throw null; } + public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, System.Func callback) { throw null; } + public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, System.Func callback) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public Microsoft.AspNetCore.Components.EventCallback CreateInferred(object receiver, System.Action callback, T value) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public Microsoft.AspNetCore.Components.EventCallback CreateInferred(object receiver, System.Func callback, T value) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, Microsoft.AspNetCore.Components.EventCallback callback) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, Microsoft.AspNetCore.Components.EventCallback callback) { throw null; } + public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, System.Action callback) { throw null; } + public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, System.Action callback) { throw null; } + public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, System.Func callback) { throw null; } + public Microsoft.AspNetCore.Components.EventCallback Create(object receiver, System.Func callback) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public string Create(object receiver, string callback) { throw null; } + } + public static partial class EventCallbackFactoryBinderExtensions + { + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, bool existingValue) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, System.DateTime existingValue) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, System.DateTime existingValue, string format) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, decimal existingValue) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, double existingValue) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, int existingValue) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, long existingValue) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, bool? existingValue) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, System.DateTime? existingValue) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, decimal? existingValue) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, double? existingValue) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, int? existingValue) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, long? existingValue) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, float? existingValue) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, float existingValue) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, string existingValue) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action setter, T existingValue) { throw null; } + } + public static partial class EventCallbackFactoryUIEventArgsExtensions + { + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Action callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func callback) { throw null; } + public static Microsoft.AspNetCore.Components.EventCallback Create(this Microsoft.AspNetCore.Components.EventCallbackFactory factory, object receiver, System.Func callback) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public partial struct EventCallbackWorkItem + { + private object _dummy; + public static readonly Microsoft.AspNetCore.Components.EventCallbackWorkItem Empty; + public EventCallbackWorkItem(System.MulticastDelegate @delegate) { throw null; } + public System.Threading.Tasks.Task InvokeAsync(object arg) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EventCallback + { + private readonly object _dummy; + public EventCallback(Microsoft.AspNetCore.Components.IHandleEvent receiver, System.MulticastDelegate @delegate) { throw null; } + public bool HasDelegate { get { throw null; } } + public System.Threading.Tasks.Task InvokeAsync(T arg) { throw null; } + } + [System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)] + public sealed partial class EventHandlerAttribute : System.Attribute + { + public EventHandlerAttribute(string attributeName, System.Type eventArgsType) { } + public string AttributeName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public System.Type EventArgsType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onabort", typeof(Microsoft.AspNetCore.Components.UIProgressEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onactivate", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onbeforeactivate", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onbeforecopy", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onbeforecut", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onbeforedeactivate", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onbeforepaste", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onblur", typeof(Microsoft.AspNetCore.Components.UIFocusEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("oncanplay", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("oncanplaythrough", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onchange", typeof(Microsoft.AspNetCore.Components.UIChangeEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onclick", typeof(Microsoft.AspNetCore.Components.UIMouseEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("oncontextmenu", typeof(Microsoft.AspNetCore.Components.UIMouseEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("oncopy", typeof(Microsoft.AspNetCore.Components.UIClipboardEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("oncuechange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("oncut", typeof(Microsoft.AspNetCore.Components.UIClipboardEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ondblclick", typeof(Microsoft.AspNetCore.Components.UIMouseEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ondeactivate", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ondrag", typeof(Microsoft.AspNetCore.Components.UIDragEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ondragend", typeof(Microsoft.AspNetCore.Components.UIDragEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ondragenter", typeof(Microsoft.AspNetCore.Components.UIDragEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ondragleave", typeof(Microsoft.AspNetCore.Components.UIDragEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ondragover", typeof(Microsoft.AspNetCore.Components.UIDragEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ondragstart", typeof(Microsoft.AspNetCore.Components.UIDragEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ondrop", typeof(Microsoft.AspNetCore.Components.UIDragEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ondurationchange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onemptied", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onended", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onerror", typeof(Microsoft.AspNetCore.Components.UIErrorEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onfocus", typeof(Microsoft.AspNetCore.Components.UIFocusEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onfocusin", typeof(Microsoft.AspNetCore.Components.UIFocusEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onfocusout", typeof(Microsoft.AspNetCore.Components.UIFocusEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onfullscreenchange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onfullscreenerror", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ongotpointercapture", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("oninput", typeof(Microsoft.AspNetCore.Components.UIChangeEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("oninvalid", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onkeydown", typeof(Microsoft.AspNetCore.Components.UIKeyboardEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onkeypress", typeof(Microsoft.AspNetCore.Components.UIKeyboardEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onkeyup", typeof(Microsoft.AspNetCore.Components.UIKeyboardEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onload", typeof(Microsoft.AspNetCore.Components.UIProgressEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onloadeddata", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onloadedmetadata", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onloadend", typeof(Microsoft.AspNetCore.Components.UIProgressEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onloadstart", typeof(Microsoft.AspNetCore.Components.UIProgressEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onlostpointercapture", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onmousedown", typeof(Microsoft.AspNetCore.Components.UIMouseEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onmousemove", typeof(Microsoft.AspNetCore.Components.UIMouseEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onmouseout", typeof(Microsoft.AspNetCore.Components.UIMouseEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onmouseover", typeof(Microsoft.AspNetCore.Components.UIMouseEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onmouseup", typeof(Microsoft.AspNetCore.Components.UIMouseEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onmousewheel", typeof(Microsoft.AspNetCore.Components.UIWheelEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onpaste", typeof(Microsoft.AspNetCore.Components.UIClipboardEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onpause", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onplay", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onplaying", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointercancel", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerdown", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerenter", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerleave", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerlockchange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerlockerror", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointermove", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerout", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerover", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onpointerup", typeof(Microsoft.AspNetCore.Components.UIPointerEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onprogress", typeof(Microsoft.AspNetCore.Components.UIProgressEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onratechange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onreadystatechange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onreset", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onscroll", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onseeked", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onseeking", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onselect", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onselectionchange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onselectstart", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onstalled", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onstop", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onsubmit", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onsuspend", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ontimeout", typeof(Microsoft.AspNetCore.Components.UIProgressEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ontimeupdate", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ontouchcancel", typeof(Microsoft.AspNetCore.Components.UITouchEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ontouchend", typeof(Microsoft.AspNetCore.Components.UITouchEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ontouchenter", typeof(Microsoft.AspNetCore.Components.UITouchEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ontouchleave", typeof(Microsoft.AspNetCore.Components.UITouchEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ontouchmove", typeof(Microsoft.AspNetCore.Components.UITouchEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("ontouchstart", typeof(Microsoft.AspNetCore.Components.UITouchEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onvolumechange", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onwaiting", typeof(Microsoft.AspNetCore.Components.UIEventArgs))] + [Microsoft.AspNetCore.Components.EventHandlerAttribute("onwheel", typeof(Microsoft.AspNetCore.Components.UIWheelEventArgs))] + public static partial class EventHandlers + { + } + public partial interface IComponent + { + void Configure(Microsoft.AspNetCore.Components.RenderHandle renderHandle); + System.Threading.Tasks.Task SetParametersAsync(Microsoft.AspNetCore.Components.ParameterCollection parameters); + } + public partial interface IComponentContext + { + bool IsConnected { get; } + } + public partial interface IHandleAfterRender + { + System.Threading.Tasks.Task OnAfterRenderAsync(); + } + public partial interface IHandleEvent + { + System.Threading.Tasks.Task HandleEventAsync(Microsoft.AspNetCore.Components.EventCallbackWorkItem item, object arg); + } + [System.AttributeUsageAttribute(System.AttributeTargets.Property, AllowMultiple=false)] + public partial class InjectAttribute : System.Attribute + { + public InjectAttribute() { } + } + public partial interface IUriHelper + { + event System.EventHandler OnLocationChanged; + string GetAbsoluteUri(); + string GetBaseUri(); + void NavigateTo(string uri); + void NavigateTo(string uri, bool forceLoad); + System.Uri ToAbsoluteUri(string href); + string ToBaseRelativePath(string baseUri, string locationAbsolute); + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MarkupString + { + private readonly object _dummy; + public MarkupString(string value) { throw null; } + public string Value { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public static explicit operator Microsoft.AspNetCore.Components.MarkupString (string value) { throw null; } + public override string ToString() { throw null; } + } + public partial class NavigationException : System.Exception + { + public NavigationException(string uri) { } + public string Location { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Parameter + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public bool Cascading { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public object Value { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + [System.AttributeUsageAttribute(System.AttributeTargets.Property, AllowMultiple=false, Inherited=false)] + public sealed partial class ParameterAttribute : System.Attribute + { + public ParameterAttribute() { } + public bool CaptureUnmatchedValues { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ParameterCollection + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public static Microsoft.AspNetCore.Components.ParameterCollection Empty { get { throw null; } } + public static Microsoft.AspNetCore.Components.ParameterCollection FromDictionary(System.Collections.Generic.IDictionary parameters) { throw null; } + public Microsoft.AspNetCore.Components.ParameterEnumerator GetEnumerator() { throw null; } + public T GetValueOrDefault(string parameterName) { throw null; } + public T GetValueOrDefault(string parameterName, T defaultValue) { throw null; } + public System.Collections.Generic.IReadOnlyDictionary ToDictionary() { throw null; } + public bool TryGetValue(string parameterName, out T result) { throw null; } + } + public static partial class ParameterCollectionExtensions + { + public static void SetParameterProperties(this in Microsoft.AspNetCore.Components.ParameterCollection parameterCollection, object target) { } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public partial struct ParameterEnumerator + { + private object _dummy; + private int _dummyPrimitive; + public Microsoft.AspNetCore.Components.Parameter Current { get { throw null; } } + public bool MoveNext() { throw null; } + } + public delegate void RenderFragment(Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder); + public delegate Microsoft.AspNetCore.Components.RenderFragment RenderFragment(T value); + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RenderHandle + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public bool IsInitialized { get { throw null; } } + public System.Threading.Tasks.Task Invoke(System.Action workItem) { throw null; } + public System.Threading.Tasks.Task InvokeAsync(System.Func workItem) { throw null; } + public void Render(Microsoft.AspNetCore.Components.RenderFragment renderFragment) { } + } + [System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=true, Inherited=false)] + public partial class RouteAttribute : System.Attribute + { + public RouteAttribute(string template) { } + public string Template { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public static partial class RuntimeHelpers + { + public static T TypeCheck(T value) { throw null; } + } + public partial class UIChangeEventArgs : Microsoft.AspNetCore.Components.UIEventArgs + { + public UIChangeEventArgs() { } + public object Value { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class UIClipboardEventArgs : Microsoft.AspNetCore.Components.UIEventArgs + { + public UIClipboardEventArgs() { } + } + public partial class UIDataTransferItem + { + public UIDataTransferItem() { } + public string Kind { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string Type { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class UIDragEventArgs : Microsoft.AspNetCore.Components.UIMouseEventArgs + { + public UIDragEventArgs() { } + public Microsoft.AspNetCore.Components.DataTransfer DataTransfer { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class UIErrorEventArgs : Microsoft.AspNetCore.Components.UIEventArgs + { + public UIErrorEventArgs() { } + public int Colno { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string Filename { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public int Lineno { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string Message { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class UIEventArgs + { + public static readonly Microsoft.AspNetCore.Components.UIEventArgs Empty; + public UIEventArgs() { } + public string Type { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public static partial class UIEventArgsRenderTreeBuilderExtensions + { + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Action value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Action value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Action value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Action value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Action value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Action value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Action value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Action value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Action value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Action value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Action value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Func value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Func value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Func value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Func value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Func value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Func value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Func value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Func value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Func value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Func value) { } + public static void AddAttribute(this Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder builder, int sequence, string name, System.Func value) { } + } + public partial class UIFocusEventArgs : Microsoft.AspNetCore.Components.UIEventArgs + { + public UIFocusEventArgs() { } + } + public partial class UIKeyboardEventArgs : Microsoft.AspNetCore.Components.UIEventArgs + { + public UIKeyboardEventArgs() { } + public bool AltKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string Code { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool CtrlKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string Key { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public float Location { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool MetaKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool Repeat { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool ShiftKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class UIMouseEventArgs : Microsoft.AspNetCore.Components.UIEventArgs + { + public UIMouseEventArgs() { } + public bool AltKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public long Button { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public long Buttons { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public double ClientX { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public double ClientY { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool CtrlKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public long Detail { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool MetaKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public double ScreenX { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public double ScreenY { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool ShiftKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class UIPointerEventArgs : Microsoft.AspNetCore.Components.UIMouseEventArgs + { + public UIPointerEventArgs() { } + public float Height { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool IsPrimary { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public long PointerId { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public string PointerType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public float Pressure { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public float TiltX { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public float TiltY { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public float Width { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class UIProgressEventArgs : Microsoft.AspNetCore.Components.UIEventArgs + { + public UIProgressEventArgs() { } + public bool LengthComputable { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public long Loaded { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public long Total { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class UITouchEventArgs : Microsoft.AspNetCore.Components.UIEventArgs + { + public UITouchEventArgs() { } + public bool AltKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public Microsoft.AspNetCore.Components.UITouchPoint[] ChangedTouches { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool CtrlKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public long Detail { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool MetaKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public bool ShiftKey { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public Microsoft.AspNetCore.Components.UITouchPoint[] TargetTouches { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public Microsoft.AspNetCore.Components.UITouchPoint[] Touches { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class UITouchPoint + { + public UITouchPoint() { } + public double ClientX { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public double ClientY { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public long Identifier { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public double PageX { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public double PageY { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public double ScreenX { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public double ScreenY { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class UIWheelEventArgs : Microsoft.AspNetCore.Components.UIMouseEventArgs + { + public UIWheelEventArgs() { } + public long DeltaMode { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public double DeltaX { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public double DeltaY { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public double DeltaZ { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public abstract partial class UriHelperBase : Microsoft.AspNetCore.Components.IUriHelper + { + protected UriHelperBase() { } + public event System.EventHandler OnLocationChanged { add { } remove { } } + protected virtual void EnsureInitialized() { } + public string GetAbsoluteUri() { throw null; } + public virtual string GetBaseUri() { throw null; } + public virtual void InitializeState(string uriAbsolute, string baseUriAbsolute) { } + public void NavigateTo(string uri) { } + public void NavigateTo(string uri, bool forceLoad) { } + protected abstract void NavigateToCore(string uri, bool forceLoad); + protected void SetAbsoluteBaseUri(string baseUri) { } + protected void SetAbsoluteUri(string uri) { } + public System.Uri ToAbsoluteUri(string href) { throw null; } + public string ToBaseRelativePath(string baseUri, string locationAbsolute) { throw null; } + protected void TriggerOnLocationChanged(bool isinterceptedLink) { } + } +} +namespace Microsoft.AspNetCore.Components.Forms +{ + public sealed partial class EditContext + { + public EditContext(object model) { } + public object Model { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public event System.EventHandler OnFieldChanged { add { } remove { } } + public event System.EventHandler OnValidationRequested { add { } remove { } } + public event System.EventHandler OnValidationStateChanged { add { } remove { } } + public Microsoft.AspNetCore.Components.Forms.FieldIdentifier Field(string fieldName) { throw null; } + public System.Collections.Generic.IEnumerable GetValidationMessages() { throw null; } + public System.Collections.Generic.IEnumerable GetValidationMessages(Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier) { throw null; } + public bool IsModified() { throw null; } + public bool IsModified(in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier) { throw null; } + public void MarkAsUnmodified() { } + public void MarkAsUnmodified(in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier) { } + public void NotifyFieldChanged(in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier) { } + public void NotifyValidationStateChanged() { } + public bool Validate() { throw null; } + } + public static partial class EditContextDataAnnotationsExtensions + { + public static Microsoft.AspNetCore.Components.Forms.EditContext AddDataAnnotationsValidation(this Microsoft.AspNetCore.Components.Forms.EditContext editContext) { throw null; } + } + public static partial class EditContextExpressionExtensions + { + public static System.Collections.Generic.IEnumerable GetValidationMessages(this Microsoft.AspNetCore.Components.Forms.EditContext editContext, System.Linq.Expressions.Expression> accessor) { throw null; } + public static bool IsModified(this Microsoft.AspNetCore.Components.Forms.EditContext editContext, System.Linq.Expressions.Expression> accessor) { throw null; } + } + public static partial class EditContextFieldClassExtensions + { + public static string FieldClass(this Microsoft.AspNetCore.Components.Forms.EditContext editContext, in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier) { throw null; } + public static string FieldClass(this Microsoft.AspNetCore.Components.Forms.EditContext editContext, System.Linq.Expressions.Expression> accessor) { throw null; } + } + public sealed partial class FieldChangedEventArgs + { + internal FieldChangedEventArgs() { } + public Microsoft.AspNetCore.Components.Forms.FieldIdentifier FieldIdentifier { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FieldIdentifier + { + private readonly object _dummy; + public FieldIdentifier(object model, string fieldName) { throw null; } + public string FieldName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public object Model { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public static Microsoft.AspNetCore.Components.Forms.FieldIdentifier Create(System.Linq.Expressions.Expression> accessor) { throw null; } + public override bool Equals(object obj) { throw null; } + public override int GetHashCode() { throw null; } + } + public sealed partial class ValidationMessageStore + { + public ValidationMessageStore(Microsoft.AspNetCore.Components.Forms.EditContext editContext) { } + public System.Collections.Generic.IEnumerable this[Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier] { get { throw null; } } + public System.Collections.Generic.IEnumerable this[System.Linq.Expressions.Expression> accessor] { get { throw null; } } + public void Add(in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier, string message) { } + public void AddRange(in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier, System.Collections.Generic.IEnumerable messages) { } + public void Clear() { } + public void Clear(in Microsoft.AspNetCore.Components.Forms.FieldIdentifier fieldIdentifier) { } + } + public static partial class ValidationMessageStoreExpressionExtensions + { + public static void Add(this Microsoft.AspNetCore.Components.Forms.ValidationMessageStore store, System.Linq.Expressions.Expression> accessor, string message) { } + public static void AddRange(this Microsoft.AspNetCore.Components.Forms.ValidationMessageStore store, System.Linq.Expressions.Expression> accessor, System.Collections.Generic.IEnumerable messages) { } + public static void Clear(this Microsoft.AspNetCore.Components.Forms.ValidationMessageStore store, System.Linq.Expressions.Expression> accessor) { } + } + public sealed partial class ValidationRequestedEventArgs + { + internal ValidationRequestedEventArgs() { } + } + public sealed partial class ValidationStateChangedEventArgs + { + internal ValidationStateChangedEventArgs() { } + } +} +namespace Microsoft.AspNetCore.Components.Layouts +{ + [System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)] + public partial class LayoutAttribute : System.Attribute + { + public LayoutAttribute(System.Type layoutType) { } + public System.Type LayoutType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public abstract partial class LayoutComponentBase : Microsoft.AspNetCore.Components.ComponentBase + { + protected LayoutComponentBase() { } + [Microsoft.AspNetCore.Components.ParameterAttribute] + protected Microsoft.AspNetCore.Components.RenderFragment Body { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } +} +namespace Microsoft.AspNetCore.Components.Rendering +{ + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComponentRenderedText + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public int ComponentId { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public System.Collections.Generic.IEnumerable Tokens { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public partial class EventFieldInfo + { + public EventFieldInfo() { } + public int ComponentId { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + public object FieldValue { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } } + } + public partial class HtmlRenderer : Microsoft.AspNetCore.Components.Rendering.Renderer + { + public HtmlRenderer(System.IServiceProvider serviceProvider, System.Func htmlEncoder, Microsoft.AspNetCore.Components.Rendering.IDispatcher dispatcher) : base (default(System.IServiceProvider)) { } + protected override void HandleException(System.Exception exception) { } + [System.Diagnostics.DebuggerStepThroughAttribute] + public System.Threading.Tasks.Task RenderComponentAsync(System.Type componentType, Microsoft.AspNetCore.Components.ParameterCollection initialParameters) { throw null; } + public System.Threading.Tasks.Task RenderComponentAsync(Microsoft.AspNetCore.Components.ParameterCollection initialParameters) where TComponent : Microsoft.AspNetCore.Components.IComponent { throw null; } + protected override System.Threading.Tasks.Task UpdateDisplayAsync(in Microsoft.AspNetCore.Components.Rendering.RenderBatch renderBatch) { throw null; } + } + public partial interface IDispatcher + { + System.Threading.Tasks.Task Invoke(System.Action action); + System.Threading.Tasks.Task InvokeAsync(System.Func asyncAction); + System.Threading.Tasks.Task InvokeAsync(System.Func> asyncFunction); + System.Threading.Tasks.Task Invoke(System.Func function); + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RenderBatch + { + private readonly object _dummy; + public Microsoft.AspNetCore.Components.RenderTree.ArrayRange DisposedComponentIDs { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Components.RenderTree.ArrayRange DisposedEventHandlerIDs { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Components.RenderTree.ArrayRange ReferenceFrames { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public Microsoft.AspNetCore.Components.RenderTree.ArrayRange UpdatedComponents { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public abstract partial class Renderer : System.IDisposable + { + public Renderer(System.IServiceProvider serviceProvider) { } + public Renderer(System.IServiceProvider serviceProvider, Microsoft.AspNetCore.Components.Rendering.IDispatcher dispatcher) { } + public event System.UnhandledExceptionEventHandler UnhandledSynchronizationException { add { } remove { } } + protected internal virtual void AddToRenderQueue(int componentId, Microsoft.AspNetCore.Components.RenderFragment renderFragment) { } + protected internal int AssignRootComponentId(Microsoft.AspNetCore.Components.IComponent component) { throw null; } + public static Microsoft.AspNetCore.Components.Rendering.IDispatcher CreateDefaultDispatcher() { throw null; } + public virtual System.Threading.Tasks.Task DispatchEventAsync(int eventHandlerId, Microsoft.AspNetCore.Components.Rendering.EventFieldInfo fieldInfo, Microsoft.AspNetCore.Components.UIEventArgs eventArgs) { throw null; } + public void Dispose() { } + protected virtual void Dispose(bool disposing) { } + protected abstract void HandleException(System.Exception exception); + protected Microsoft.AspNetCore.Components.IComponent InstantiateComponent(System.Type componentType) { throw null; } + public virtual System.Threading.Tasks.Task Invoke(System.Action workItem) { throw null; } + public virtual System.Threading.Tasks.Task InvokeAsync(System.Func workItem) { throw null; } + protected System.Threading.Tasks.Task RenderRootComponentAsync(int componentId) { throw null; } + [System.Diagnostics.DebuggerStepThroughAttribute] + protected System.Threading.Tasks.Task RenderRootComponentAsync(int componentId, Microsoft.AspNetCore.Components.ParameterCollection initialParameters) { throw null; } + protected abstract System.Threading.Tasks.Task UpdateDisplayAsync(in Microsoft.AspNetCore.Components.Rendering.RenderBatch renderBatch); + } +} +namespace Microsoft.AspNetCore.Components.RenderTree +{ + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ArrayRange + { + public readonly T[] Array; + public readonly int Count; + public ArrayRange(T[] array, int count) { throw null; } + public Microsoft.AspNetCore.Components.RenderTree.ArrayRange Clone() { throw null; } + } + public partial class RenderTreeBuilder + { + public const string ChildContent = "ChildContent"; + public RenderTreeBuilder(Microsoft.AspNetCore.Components.Rendering.Renderer renderer) { } + public void AddAttribute(int sequence, in Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrame frame) { } + public void AddAttribute(int sequence, string name, Microsoft.AspNetCore.Components.EventCallback value) { } + public void AddAttribute(int sequence, string name, System.Action value) { } + public void AddAttribute(int sequence, string name, System.Action value) { } + public void AddAttribute(int sequence, string name, bool value) { } + public void AddAttribute(int sequence, string name, System.Func value) { } + public void AddAttribute(int sequence, string name, System.Func value) { } + public void AddAttribute(int sequence, string name, System.MulticastDelegate value) { } + public void AddAttribute(int sequence, string name, object value) { } + public void AddAttribute(int sequence, string name, string value) { } + public void AddAttribute(int sequence, string name, Microsoft.AspNetCore.Components.EventCallback value) { } + public void AddComponentReferenceCapture(int sequence, System.Action componentReferenceCaptureAction) { } + public void AddContent(int sequence, Microsoft.AspNetCore.Components.MarkupString markupContent) { } + public void AddContent(int sequence, Microsoft.AspNetCore.Components.RenderFragment fragment) { } + public void AddContent(int sequence, object textContent) { } + public void AddContent(int sequence, string textContent) { } + public void AddContent(int sequence, Microsoft.AspNetCore.Components.RenderFragment fragment, T value) { } + public void AddElementReferenceCapture(int sequence, System.Action elementReferenceCaptureAction) { } + public void AddMarkupContent(int sequence, string markupContent) { } + public void AddMultipleAttributes(int sequence, System.Collections.Generic.IEnumerable> attributes) { } + public void Clear() { } + public void CloseComponent() { } + public void CloseElement() { } + public Microsoft.AspNetCore.Components.RenderTree.ArrayRange GetFrames() { throw null; } + public void OpenComponent(int sequence, System.Type componentType) { } + public void OpenComponent(int sequence) where TComponent : Microsoft.AspNetCore.Components.IComponent { } + public void OpenElement(int sequence, string elementName) { } + public void SetKey(object value) { } + public void SetUpdatesAttributeName(string updatesAttributeName) { } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RenderTreeDiff + { + public readonly int ComponentId; + public readonly System.ArraySegment Edits; + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Explicit)] + public readonly partial struct RenderTreeEdit + { + [System.Runtime.InteropServices.FieldOffsetAttribute(8)] + public readonly int MoveToSiblingIndex; + [System.Runtime.InteropServices.FieldOffsetAttribute(8)] + public readonly int ReferenceFrameIndex; + [System.Runtime.InteropServices.FieldOffsetAttribute(16)] + public readonly string RemovedAttributeName; + [System.Runtime.InteropServices.FieldOffsetAttribute(4)] + public readonly int SiblingIndex; + [System.Runtime.InteropServices.FieldOffsetAttribute(0)] + public readonly Microsoft.AspNetCore.Components.RenderTree.RenderTreeEditType Type; + } + public enum RenderTreeEditType + { + PrependFrame = 1, + RemoveFrame = 2, + SetAttribute = 3, + RemoveAttribute = 4, + UpdateText = 5, + StepIn = 6, + StepOut = 7, + UpdateMarkup = 8, + PermutationListEntry = 9, + PermutationListEnd = 10, + } + public enum RenderTreeFrameType + { + None = 0, + Element = 1, + Text = 2, + Attribute = 3, + Component = 4, + Region = 5, + ElementReferenceCapture = 6, + ComponentReferenceCapture = 7, + Markup = 8, + } +} +namespace Microsoft.AspNetCore.Components.Routing +{ + public partial interface INavigationInterception + { + System.Threading.Tasks.Task EnableNavigationInterceptionAsync(); + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LocationChangedEventArgs + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LocationChangedEventArgs(string location, bool isNavigationIntercepted) { throw null; } + public bool IsNavigationIntercepted { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + public string Location { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } } + } + public enum NavLinkMatch + { + Prefix = 0, + All = 1, + } +} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindAttributes.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindAttributes.cs deleted file mode 100644 index 6d319c0b60..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindAttributes.cs +++ /dev/null @@ -1,30 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Infrastructure for the discovery of bind attributes for markup elements. - /// - /// - /// To extend the set of bind attributes, define a public class named - /// BindAttributes and annotate it with the appropriate attributes. - /// - - // Handles cases like - this is a fallback and will be ignored - // when a specific type attribute is applied. - [BindInputElement(null, null, "value", "onchange")] - - // Handles cases like - this is a fallback and will be ignored - // when a specific type attribute is applied. - [BindInputElement(null, "value", "value", "onchange")] - - [BindInputElement("checkbox", null, "checked", "onchange")] - [BindInputElement("text", null, "value", "onchange")] - - [BindElement("select", null, "value", "onchange")] - [BindElement("textarea", null, "value", "onchange")] - public static class BindAttributes - { - } -} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindElementAttribute.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindElementAttribute.cs deleted file mode 100644 index 710ab6c9f9..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindElementAttribute.cs +++ /dev/null @@ -1,64 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Configures options for binding specific element types. - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] - public sealed class BindElementAttribute : Attribute - { - /// - /// Constructs an instance of . - /// - /// The tag name of the element. - /// The suffix value. For example, set this to value for bind-value, or set this to null for bind. - /// The name of the value attribute to be bound. - /// The name of an attribute that will register an associated change event. - public BindElementAttribute(string element, string suffix, string valueAttribute, string changeAttribute) - { - if (element == null) - { - throw new ArgumentNullException(nameof(element)); - } - - if (valueAttribute == null) - { - throw new ArgumentNullException(nameof(valueAttribute)); - } - - if (changeAttribute == null) - { - throw new ArgumentNullException(nameof(changeAttribute)); - } - - Element = element; - ValueAttribute = valueAttribute; - ChangeAttribute = changeAttribute; - } - - /// - /// Gets the tag name of the element. - /// - public string Element { get; } - - /// - /// Gets the suffix value. - /// For example, this will be value to mean bind-value, or null to mean bind. - /// - public string Suffix { get; } - - /// - /// Gets the name of the value attribute to be bound. - /// - public string ValueAttribute { get; } - - /// - /// Gets the name of an attribute that will register an associated change event. - /// - public string ChangeAttribute { get; } - } -} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindInputElementAttribute.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindInputElementAttribute.cs deleted file mode 100644 index 16c65cf536..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindInputElementAttribute.cs +++ /dev/null @@ -1,59 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Configures options for binding subtypes of an HTML input element. - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] - public sealed class BindInputElementAttribute : Attribute - { - /// - /// Constructs an instance of . - /// - /// The value of the element's type attribute. - /// The suffix value. - /// The name of the value attribute to be bound. - /// The name of an attribute that will register an associated change event. - public BindInputElementAttribute(string type, string suffix, string valueAttribute, string changeAttribute) - { - if (valueAttribute == null) - { - throw new ArgumentNullException(nameof(valueAttribute)); - } - - if (changeAttribute == null) - { - throw new ArgumentNullException(nameof(changeAttribute)); - } - - Type = type; - Suffix = suffix; - ValueAttribute = valueAttribute; - ChangeAttribute = changeAttribute; - } - - /// - /// Gets the value of the element's type attribute. - /// - public string Type { get; } - - /// - /// Gets the suffix value. - /// - public string Suffix { get; } - - /// - /// Gets the name of the value attribute to be bound. - /// - public string ValueAttribute { get; } - - /// - /// Gets the name of an attribute that will register an associated change event. - /// - public string ChangeAttribute { get; } - } -} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindMethods.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindMethods.cs deleted file mode 100644 index 3e4b51b60e..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/BindMethods.cs +++ /dev/null @@ -1,247 +0,0 @@ -// 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.Globalization; -using System.Threading.Tasks; - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Methods used internally by @bind syntax. Not intended to be used directly. - /// - public static class BindMethods - { - /// - /// Not intended to be used directly. - /// - public static T GetValue(T value) => value; - - /// - /// Not intended to be used directly. - /// - public static string GetValue(DateTime value, string format) => - value == default ? null - : (format == null ? value.ToString() : value.ToString(format)); - - /// - /// Not intended to be used directly. - /// - public static string GetEventHandlerValue(string value) - where T : UIEventArgs - { - return value; - } - - /// - /// Not intended to be used directly. - /// - public static MulticastDelegate GetEventHandlerValue(Action value) - where T : UIEventArgs - { - return value; - } - - /// - /// Not intended to be used directly. - /// - public static MulticastDelegate GetEventHandlerValue(Func value) - where T : UIEventArgs - { - return value; - } - - /// - /// Not intended to be used directly. - /// - public static MulticastDelegate GetEventHandlerValue(Action value) - where T : UIEventArgs - { - return value; - } - - /// - /// Not intended to be used directly. - /// - public static MulticastDelegate GetEventHandlerValue(Func value) - where T : UIEventArgs - { - return value; - } - - /// - /// Not intended to be used directly. - /// - public static EventCallback GetEventHandlerValue(EventCallback value) - where T : UIEventArgs - { - return value; - } - - /// - /// Not intended to be used directly. - /// - public static EventCallback GetEventHandlerValue(EventCallback value) - where T : UIEventArgs - { - return value; - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, string existingValue) - { - return _ => setter((string)((UIChangeEventArgs)_).Value); - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, bool existingValue) - { - return _ => setter((bool)((UIChangeEventArgs)_).Value); - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, bool? existingValue) - { - return _ => setter((bool?)((UIChangeEventArgs)_).Value); - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, int existingValue) - { - return _ => setter(int.Parse((string)((UIChangeEventArgs)_).Value)); - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, int? existingValue) - { - return _ => setter(int.TryParse((string)((UIChangeEventArgs)_).Value, out var tmpvalue) - ? tmpvalue - : (int?)null); - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, long existingValue) - { - return _ => setter(long.Parse((string)((UIChangeEventArgs)_).Value)); - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, long? existingValue) - { - return _ => setter(long.TryParse((string)((UIChangeEventArgs)_).Value, out var tmpvalue) - ? tmpvalue - : (long?)null); - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, float existingValue) - { - return _ => setter(float.Parse((string)((UIChangeEventArgs)_).Value)); - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, float? existingValue) - { - return _ => setter(float.TryParse((string)((UIChangeEventArgs)_).Value, out var tmpvalue) - ? tmpvalue - : (float?)null); - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, double existingValue) - { - return _ => setter(double.Parse((string)((UIChangeEventArgs)_).Value)); - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, double? existingValue) - { - return _ => setter(double.TryParse((string)((UIChangeEventArgs)_).Value, out var tmpvalue) - ? tmpvalue - : (double?)null); - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, decimal existingValue) - { - return _ => setter(decimal.Parse((string)((UIChangeEventArgs)_).Value)); - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, decimal? existingValue) - { - return _ => setter(decimal.TryParse((string)((UIChangeEventArgs)_).Value, out var tmpvalue) - ? tmpvalue - : (decimal?)null); - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, DateTime existingValue) - { - return _ => SetDateTimeValue(setter, ((UIChangeEventArgs)_).Value, null); - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, DateTime existingValue, string format) - { - return _ => SetDateTimeValue(setter, ((UIChangeEventArgs)_).Value, format); - } - - /// - /// Not intended to be used directly. - /// - public static Action SetValueHandler(Action setter, T existingValue) - { - if (!typeof(T).IsEnum) - { - throw new ArgumentException($"'bind' does not accept values of type {typeof(T).FullName}. To read and write this value type, wrap it in a property of type string with suitable getters and setters."); - } - - return _ => - { - var value = (string)((UIChangeEventArgs)_).Value; - var parsed = (T)Enum.Parse(typeof(T), value); - setter(parsed); - }; - } - - private static void SetDateTimeValue(Action setter, object objValue, string format) - { - var stringValue = (string)objValue; - var parsedValue = string.IsNullOrEmpty(stringValue) ? default - : format != null && DateTime.TryParseExact(stringValue, format, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out var parsedExact) ? parsedExact - : DateTime.Parse(stringValue); - setter(parsedValue); - } - } -} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ComponentBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ComponentBase.cs deleted file mode 100644 index 4ec8e784fe..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ComponentBase.cs +++ /dev/null @@ -1,27 +0,0 @@ -// 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.Threading.Tasks; -using Microsoft.AspNetCore.Components.RenderTree; - -namespace Microsoft.AspNetCore.Components -{ - public abstract class ComponentBase : IComponent - { - protected virtual void BuildRenderTree(RenderTreeBuilder builder) - { - } - - public virtual void SetParameters(ParameterCollection parameters) - { - } - - void IComponent.Init(RenderHandle renderHandle) - { - } - - protected virtual Task OnInitAsync() => Task.CompletedTask; - - protected void WriteLiteral(string literal) { } - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ElementRef.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ElementRef.cs deleted file mode 100644 index 06d6c9d370..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ElementRef.cs +++ /dev/null @@ -1,12 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Represents a reference to a rendered element. - /// - public struct ElementRef - { - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallback.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallback.cs deleted file mode 100644 index 52c4fe1aab..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallback.cs +++ /dev/null @@ -1,33 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Components -{ - public readonly struct EventCallback - { - public static readonly EventCallbackFactory Factory = new EventCallbackFactory(); - - internal readonly MulticastDelegate Delegate; - internal readonly IHandleEvent Receiver; - - public EventCallback(IHandleEvent receiver, MulticastDelegate @delegate) - { - Receiver = receiver; - Delegate = @delegate; - } - } - - public readonly struct EventCallback - { - internal readonly MulticastDelegate Delegate; - internal readonly IHandleEvent Receiver; - - public EventCallback(IHandleEvent receiver, MulticastDelegate @delegate) - { - Receiver = receiver; - Delegate = @delegate; - } - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallbackFactory.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallbackFactory.cs deleted file mode 100644 index 882490199c..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallbackFactory.cs +++ /dev/null @@ -1,43 +0,0 @@ -// 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.Threading.Tasks; - -namespace Microsoft.AspNetCore.Components -{ - public sealed class EventCallbackFactory - { - public EventCallback Create(object receiver, EventCallback callback) => default; - - public EventCallback Create(object receiver, Action callback) => default; - - public EventCallback Create(object receiver, Action callback) => default; - - public EventCallback Create(object receiver, Func callback) => default; - - public EventCallback Create(object receiver, Func callback) => default; - - public string Create(object receiver, string callback) => default; - - public EventCallback Create(object receiver, EventCallback callback) => default; - - public EventCallback Create(object receiver, Action callback) => default; - - public EventCallback Create(object receiver, Action callback) => default; - - public EventCallback Create(object receiver, Func callback) => default; - - public EventCallback Create(object receiver, Func callback) => default; - - public EventCallback CreateInferred(object receiver, Action callback, T value) - { - return Create(receiver, callback); - } - - public EventCallback CreateInferred(object receiver, Func callback, T value) - { - return Create(receiver, callback); - } - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallbackFactoryBinderExtensions.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallbackFactoryBinderExtensions.cs deleted file mode 100644 index 8a920ff53c..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallbackFactoryBinderExtensions.cs +++ /dev/null @@ -1,107 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Components -{ - public static class EventCallbackFactoryBinderExtensions - { - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - string existingValue) => default; - - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - bool existingValue) => default; - - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - bool? existingValue) => default; - - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - int existingValue) => default; - - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - int? existingValue) => default; - - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - long existingValue) => default; - - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - long? existingValue) => default; - - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - float existingValue) => default; - - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - float? existingValue) => default; - - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - double existingValue) => default; - - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - double? existingValue) => default; - - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - decimal existingValue) => default; - - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - decimal? existingValue) => default; - - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - DateTime existingValue) => default; - - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - DateTime existingValue, - string format) => default; - - public static EventCallback CreateBinder( - this EventCallbackFactory factory, - object receiver, - Action setter, - T existingValue) where T : Enum => default; - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallbackFactoryUIEventArgsExtensions.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallbackFactoryUIEventArgsExtensions.cs deleted file mode 100644 index c81d09fd07..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventCallbackFactoryUIEventArgsExtensions.cs +++ /dev/null @@ -1,59 +0,0 @@ -// 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.Threading.Tasks; - -namespace Microsoft.AspNetCore.Components -{ - public static class EventCallbackFactoryUIEventArgsExtensions - { - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Action callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Func callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Action callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Func callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Action callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Func callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Action callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Func callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Action callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Func callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Action callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Func callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Action callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Func callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Action callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Func callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Action callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Func callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Action callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Func callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Action callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Func callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Action callback) => default; - - public static EventCallback Create(this EventCallbackFactory factory, object receiver, Func callback) => default; - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventHandlerAttribute.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventHandlerAttribute.cs deleted file mode 100644 index 8397d4ac12..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventHandlerAttribute.cs +++ /dev/null @@ -1,45 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Associates an event argument type with an event attribute name. - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] - public sealed class EventHandlerAttribute : Attribute - { - /// - /// Constructs an instance of . - /// - /// - /// - public EventHandlerAttribute(string attributeName, Type eventArgsType) - { - if (attributeName == null) - { - throw new ArgumentNullException(nameof(attributeName)); - } - - if (eventArgsType == null) - { - throw new ArgumentNullException(nameof(eventArgsType)); - } - - AttributeName = attributeName; - EventArgsType = eventArgsType; - } - - /// - /// Gets the attribute name. - /// - public string AttributeName { get; } - - /// - /// Gets the event argument type. - /// - public Type EventArgsType { get; } - } -} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventHandlers.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventHandlers.cs deleted file mode 100644 index 6ae6031d9b..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/EventHandlers.cs +++ /dev/null @@ -1,128 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Holds attributes to configure the mappings between event names and - /// event argument types. - /// - - // Focus events - [EventHandler("onfocus", typeof(UIFocusEventArgs))] - [EventHandler("onblur", typeof(UIFocusEventArgs))] - [EventHandler("onfocusin", typeof(UIFocusEventArgs))] - [EventHandler("onfocusout", typeof(UIFocusEventArgs))] - - // Mouse events - [EventHandler("onmouseover", typeof(UIMouseEventArgs))] - [EventHandler("onmouseout", typeof(UIMouseEventArgs))] - [EventHandler("onmousemove", typeof(UIMouseEventArgs))] - [EventHandler("onmousedown", typeof(UIMouseEventArgs))] - [EventHandler("onmouseup", typeof(UIMouseEventArgs))] - [EventHandler("onclick", typeof(UIMouseEventArgs))] - [EventHandler("ondblclick", typeof(UIMouseEventArgs))] - [EventHandler("onwheel", typeof(UIWheelEventArgs))] - [EventHandler("onmousewheel", typeof(UIWheelEventArgs))] - [EventHandler("oncontextmenu", typeof(UIMouseEventArgs))] - - // Drag events - [EventHandler("ondrag", typeof(UIDragEventArgs))] - [EventHandler("ondragend", typeof(UIDragEventArgs))] - [EventHandler("ondragenter", typeof(UIDragEventArgs))] - [EventHandler("ondragleave", typeof(UIDragEventArgs))] - [EventHandler("ondragover", typeof(UIDragEventArgs))] - [EventHandler("ondragstart", typeof(UIDragEventArgs))] - [EventHandler("ondrop", typeof(UIDragEventArgs))] - - // Keyboard events - [EventHandler("onkeydown", typeof(UIKeyboardEventArgs))] - [EventHandler("onkeyup", typeof(UIKeyboardEventArgs))] - [EventHandler("onkeypress", typeof(UIKeyboardEventArgs))] - - // Input events - [EventHandler("onchange", typeof(UIChangeEventArgs))] - [EventHandler("oninput", typeof(UIChangeEventArgs))] - [EventHandler("oninvalid", typeof(UIEventArgs))] - [EventHandler("onreset", typeof(UIEventArgs))] - [EventHandler("onselect", typeof(UIEventArgs))] - [EventHandler("onselectstart", typeof(UIEventArgs))] - [EventHandler("onselectionchange", typeof(UIEventArgs))] - [EventHandler("onsubmit", typeof(UIEventArgs))] - - // Clipboard events - [EventHandler("onbeforecopy", typeof(UIEventArgs))] - [EventHandler("onbeforecut", typeof(UIEventArgs))] - [EventHandler("onbeforepaste", typeof(UIEventArgs))] - [EventHandler("oncopy", typeof(UIClipboardEventArgs))] - [EventHandler("oncut", typeof(UIClipboardEventArgs))] - [EventHandler("onpaste", typeof(UIClipboardEventArgs))] - - // Touch events - [EventHandler("ontouchcancel", typeof(UITouchEventArgs))] - [EventHandler("ontouchend", typeof(UITouchEventArgs))] - [EventHandler("ontouchmove", typeof(UITouchEventArgs))] - [EventHandler("ontouchstart", typeof(UITouchEventArgs))] - [EventHandler("ontouchenter", typeof(UITouchEventArgs))] - [EventHandler("ontouchleave", typeof(UITouchEventArgs))] - - // Pointer events - [EventHandler("gotpointercapture", typeof(UIPointerEventArgs))] - [EventHandler("lostpointercapture", typeof(UIPointerEventArgs))] - [EventHandler("pointercancel", typeof(UIPointerEventArgs))] - [EventHandler("pointerdown", typeof(UIPointerEventArgs))] - [EventHandler("pointerenter", typeof(UIPointerEventArgs))] - [EventHandler("pointerleave", typeof(UIPointerEventArgs))] - [EventHandler("pointermove", typeof(UIPointerEventArgs))] - [EventHandler("pointerout", typeof(UIPointerEventArgs))] - [EventHandler("pointerover", typeof(UIPointerEventArgs))] - [EventHandler("pointerup", typeof(UIPointerEventArgs))] - - // Media events - [EventHandler("oncanplay", typeof(UIEventArgs))] - [EventHandler("oncanplaythrough", typeof(UIEventArgs))] - [EventHandler("oncuechange", typeof(UIEventArgs))] - [EventHandler("ondurationchange", typeof(UIEventArgs))] - [EventHandler("onemptied", typeof(UIEventArgs))] - [EventHandler("onpause", typeof(UIEventArgs))] - [EventHandler("onplay", typeof(UIEventArgs))] - [EventHandler("onplaying", typeof(UIEventArgs))] - [EventHandler("onratechange", typeof(UIEventArgs))] - [EventHandler("onseeked", typeof(UIEventArgs))] - [EventHandler("onseeking", typeof(UIEventArgs))] - [EventHandler("onstalled", typeof(UIEventArgs))] - [EventHandler("onstop", typeof(UIEventArgs))] - [EventHandler("onsuspend", typeof(UIEventArgs))] - [EventHandler("ontimeupdate", typeof(UIEventArgs))] - [EventHandler("onvolumechange", typeof(UIEventArgs))] - [EventHandler("onwaiting", typeof(UIEventArgs))] - - // Progress events - [EventHandler("onloadstart", typeof(UIProgressEventArgs))] - [EventHandler("ontimeout", typeof(UIProgressEventArgs))] - [EventHandler("onabort", typeof(UIProgressEventArgs))] - [EventHandler("onload", typeof(UIProgressEventArgs))] - [EventHandler("onloadend", typeof(UIProgressEventArgs))] - [EventHandler("onprogress", typeof(UIProgressEventArgs))] - [EventHandler("onerror", typeof(UIErrorEventArgs))] - - // General events - [EventHandler("onactivate", typeof(UIEventArgs))] - [EventHandler("onbeforeactivate", typeof(UIEventArgs))] - [EventHandler("onbeforedeactivate", typeof(UIEventArgs))] - [EventHandler("ondeactivate", typeof(UIEventArgs))] - [EventHandler("onended", typeof(UIEventArgs))] - [EventHandler("onfullscreenchange", typeof(UIEventArgs))] - [EventHandler("onfullscreenerror", typeof(UIEventArgs))] - [EventHandler("onloadeddata", typeof(UIEventArgs))] - [EventHandler("onloadedmetadata", typeof(UIEventArgs))] - [EventHandler("onpointerlockchange", typeof(UIEventArgs))] - [EventHandler("onpointerlockerror", typeof(UIEventArgs))] - [EventHandler("onreadystatechange", typeof(UIEventArgs))] - [EventHandler("onscroll", typeof(UIEventArgs))] - public static class EventHandlers - { - } -} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/IComponent.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/IComponent.cs deleted file mode 100644 index 0f909c5d71..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/IComponent.cs +++ /dev/null @@ -1,13 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Components -{ - public interface IComponent - { - void Init(RenderHandle renderHandle); - - - void SetParameters(ParameterCollection parameters); - } -} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/IHandleEvent.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/IHandleEvent.cs deleted file mode 100644 index b5ba9a87c8..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/IHandleEvent.cs +++ /dev/null @@ -1,9 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Components -{ - public interface IHandleEvent - { - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/InjectAttribute.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/InjectAttribute.cs deleted file mode 100644 index 3490c456ce..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/InjectAttribute.cs +++ /dev/null @@ -1,16 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Indicates that the associated property should have a value injected from the - /// service provider during initialization. - /// - [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] - public class InjectAttribute : Attribute - { - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/Layouts/LayoutAttribute.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/Layouts/LayoutAttribute.cs deleted file mode 100644 index 63f6d64e4a..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/Layouts/LayoutAttribute.cs +++ /dev/null @@ -1,21 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Components.Layouts -{ - /// - /// Indicates that the associated component type uses a specified layout. - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] - public class LayoutAttribute : Attribute - { - public LayoutAttribute(Type layoutType) - { - LayoutType = layoutType ?? throw new ArgumentNullException(nameof(layoutType)); - } - - public Type LayoutType { get; } - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/MarkupString.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/MarkupString.cs deleted file mode 100644 index 16ec54fd3b..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/MarkupString.cs +++ /dev/null @@ -1,36 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Components -{ - /// - /// A string value that can be rendered as markup such as HTML. - /// - public struct MarkupString - { - /// - /// Constructs an instance of . - /// - /// The value for the new instance. - public MarkupString(string value) - { - Value = value; - } - - /// - /// Gets the value of the . - /// - public string Value { get; } - - /// - /// Casts a to a . - /// - /// The value. - public static explicit operator MarkupString(string value) - => new MarkupString(value); - - /// - public override string ToString() - => Value ?? string.Empty; - } -} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ParameterAttribute.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ParameterAttribute.cs deleted file mode 100644 index 5351c619fb..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ParameterAttribute.cs +++ /dev/null @@ -1,15 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Denotes the target member as a component parameter. - /// - [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)] - public sealed class ParameterAttribute : Attribute - { - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ParameterCollection.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ParameterCollection.cs deleted file mode 100644 index f055fa6e9b..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/ParameterCollection.cs +++ /dev/null @@ -1,13 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Represents a collection of parameters supplied to an - /// by its parent in the render tree. - /// - public struct ParameterCollection - { - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RenderFrame.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RenderFrame.cs deleted file mode 100644 index 01c9e70b1a..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RenderFrame.cs +++ /dev/null @@ -1,22 +0,0 @@ -// 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 Microsoft.AspNetCore.Components.RenderTree; - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Represents a segment of UI content, implemented as a delegate that - /// writes the content to a . - /// - /// The to which the content should be written. - public delegate void RenderFragment(RenderTreeBuilder builder); - - /// - /// Represents a segment of UI content for an object of type , implemented as - /// a function that returns a . - /// - /// The type of object. - /// The value used to build the content. - public delegate RenderFragment RenderFragment(T value); -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RenderHandle.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RenderHandle.cs deleted file mode 100644 index b0034b801f..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RenderHandle.cs +++ /dev/null @@ -1,12 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Allows a component to notify the renderer that it should be rendered. - /// - public struct RenderHandle - { - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RenderTree/RenderTreeBuilder.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RenderTree/RenderTreeBuilder.cs deleted file mode 100644 index 98d8a0bdb4..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RenderTree/RenderTreeBuilder.cs +++ /dev/null @@ -1,119 +0,0 @@ -// 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.Collections.Generic; -using System.Threading.Tasks; - -namespace Microsoft.AspNetCore.Components.RenderTree -{ - /// - /// Provides methods for building a collection of entries. - /// - public class RenderTreeBuilder - { - public void OpenElement(int sequence, string elementName) - { - } - - public void CloseElement() - { - } - - public void AddMarkupContent(int sequence, string markupContent) - { - } - - public void AddContent(int sequence, string textContent) - { - } - - public void AddContent(int sequence, RenderFragment fragment) - { - } - - public void AddContent(int sequence, RenderFragment fragment, T value) - { - } - - public void AddContent(int sequence, MarkupString markupContent) - { - } - - public void AddContent(int sequence, object textContent) - { - } - - public void AddAttribute(int sequence, string name, bool value) - { - } - - public void AddAttribute(int sequence, string name, string value) - { - } - - public void AddAttribute(int sequence, string name, Action value) - { - } - - public void AddAttribute(int sequence, string name, Action value) - { - } - - public void AddAttribute(int sequence, string name, Func value) - { - } - - public void AddAttribute(int sequence, string name, Func value) - { - } - - public void AddAttribute(int sequence, string name, MulticastDelegate value) - { - } - - public void AddAttribute(int sequence, string name, EventCallback value) - { - } - - public void AddAttribute(int sequence, string name, EventCallback value) - { - } - - public void AddAttribute(int sequence, string name, object value) - { - } - - public void AddMultipleAttributes(int sequence, IEnumerable> attributes) - { - } - - public void OpenComponent(int sequence) where TComponent : IComponent - { - } - - public void OpenComponent(int sequence, Type componentType) - { - } - - public void CloseComponent() - { - } - - public void AddElementReferenceCapture(int sequence, Action elementReferenceCaptureAction) - { - } - - public void AddComponentReferenceCapture(int sequence, Action componentReferenceCaptureAction) - { - } - - public void SetKey(object key) - { - } - - public void SetUpdatesAttributeName(string updatesAttributeName) - { - } - } -} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RouteAttribute.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RouteAttribute.cs deleted file mode 100644 index e8c4880072..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RouteAttribute.cs +++ /dev/null @@ -1,33 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Indicates that the associated component should match the specified route template pattern. - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] - public class RouteAttribute : Attribute - { - /// - /// Constructs an instance of . - /// - /// The route template. - public RouteAttribute(string template) - { - if (template == null) - { - throw new ArgumentNullException(nameof(template)); - } - - Template = template; - } - - /// - /// Gets the route template. - /// - public string Template { get; } - } -} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RuntimeHelpers.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RuntimeHelpers.cs deleted file mode 100644 index 84ab120f01..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/RuntimeHelpers.cs +++ /dev/null @@ -1,20 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Used by generated code produced by the code generator. Not intended or supported - /// for use in application code. - /// - public static class RuntimeHelpers - { - /// - /// Not intended for use by application code. - /// - /// - /// - /// - public static T TypeCheck(T value) => value; - } -} \ No newline at end of file diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/UIEventArgs.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/UIEventArgs.cs deleted file mode 100644 index 953300d8a9..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/UIEventArgs.cs +++ /dev/null @@ -1,518 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Supplies information about an event that is being raised. - /// - public class UIEventArgs - { - /// - /// Gets or sets the type of the event. - /// - public string Type { get; set; } - } - - /// - /// Supplies information about an input change event that is being raised. - /// - public class UIChangeEventArgs : UIEventArgs - { - /// - /// Gets or sets the new value of the input. This may be a - /// or a . - /// - public object Value { get; set; } - } - - /// - /// Supplies information about an clipboard event that is being raised. - /// - public class UIClipboardEventArgs : UIEventArgs - { - } - - /// - /// Supplies information about an drag event that is being raised. - /// - public class UIDragEventArgs : UIEventArgs - { - /// - /// A count of consecutive clicks that happened in a short amount of time, incremented by one. - /// - public long Detail { get; set; } - - /// - /// The data that underlies a drag-and-drop operation, known as the drag data store. - /// See . - /// - public DataTransfer DataTransfer { get; set; } - - /// - /// The X coordinate of the mouse pointer in global (screen) coordinates. - /// - public long ScreenX { get; set; } - - /// - /// The Y coordinate of the mouse pointer in global (screen) coordinates. - /// - public long ScreenY { get; set; } - - /// - /// The X coordinate of the mouse pointer in local (DOM content) coordinates. - /// - public long ClientX { get; set; } - - /// - /// The Y coordinate of the mouse pointer in local (DOM content) coordinates. - /// - public long ClientY { get; set; } - - /// - /// The button number that was pressed when the mouse event was fired: - /// Left button=0, - /// middle button=1 (if present), - /// right button=2. - /// For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left. - /// - public long Button { get; set; } - - /// - /// The buttons being pressed when the mouse event was fired: - /// Left button=1, - /// Right button=2, - /// Middle (wheel) button=4, - /// 4th button (typically, "Browser Back" button)=8, - /// 5th button (typically, "Browser Forward" button)=16. - /// If two or more buttons are pressed, returns the logical sum of the values. - /// E.g., if Left button and Right button are pressed, returns 3 (=1 | 2). - /// - public long Buttons { get; set; } - - /// - /// true if the control key was down when the event was fired. false otherwise. - /// - public bool CtrlKey { get; set; } - - /// - /// true if the shift key was down when the event was fired. false otherwise. - /// - public bool ShiftKey { get; set; } - - /// - /// true if the alt key was down when the event was fired. false otherwise. - /// - public bool AltKey { get; set; } - - /// - /// true if the meta key was down when the event was fired. false otherwise. - /// - public bool MetaKey { get; set; } - } - - /// - /// The object is used to hold the data that is being dragged during a drag and drop operation. - /// It may hold one or more , each of one or more data types. - /// For more information about drag and drop, see HTML Drag and Drop API. - /// - public class DataTransfer - { - /// - /// Gets the type of drag-and-drop operation currently selected or sets the operation to a new type. - /// The value must be none, copy, link or move. - /// - public string DropEffect { get; set; } - - /// - /// Provides all of the types of operations that are possible. - /// Must be one of none, copy, copyLink, copyMove, link, linkMove, move, all or uninitialized. - /// - public string EffectAllowed { get; set; } - - /// - /// Contains a list of all the local files available on the data transfer. - /// If the drag operation doesn't involve dragging files, this property is an empty list. - /// - public string[] Files { get; set; } - - /// - /// Gives a array which is a list of all of the drag data. - /// - public UIDataTransferItem[] Items { get; set; } - - /// - /// An array of giving the formats that were set in the dragstart event. - /// - public string[] Types { get; set; } - } - - /// - /// The object represents one drag data item. - /// During a drag operation, each drag event has a dataTransfer property which contains a list of drag data items. - /// Each item in the list is a object. - /// - public class UIDataTransferItem - { - /// - /// The kind of drag data item, string or file - /// - public string Kind { get; set; } - - /// - /// The drag data item's type, typically a MIME type - /// - public string Type { get; set; } - } - - /// - /// Supplies information about an error event that is being raised. - /// - public class UIErrorEventArgs : UIEventArgs - { - /// - /// Gets a a human-readable error message describing the problem. - /// - public string Message { get; set; } - - /// - /// Gets the name of the script file in which the error occurred. - /// - public string Filename { get; set; } - - /// - /// Gets the line number of the script file on which the error occurred. - /// - public int Lineno { get; set; } - - /// - /// Gets the column number of the script file on which the error occurred. - /// - public int Colno { get; set; } - } - - /// - /// Supplies information about a focus event that is being raised. - /// - public class UIFocusEventArgs : UIEventArgs - { - // Not including support for 'relatedTarget' since we don't have a good way to represent it. - // see: https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent - } - - /// - /// Supplies information about a keyboard event that is being raised. - /// - public class UIKeyboardEventArgs : UIEventArgs - { - /// - /// The key value of the key represented by the event. - /// If the value has a printed representation, this attribute's value is the same as the char attribute. - /// Otherwise, it's one of the key value strings specified in 'Key values'. - /// If the key can't be identified, this is the string "Unidentified" - /// - public string Key { get; set; } - - /// - /// Holds a string that identifies the physical key being pressed. - /// The value is not affected by the current keyboard layout or modifier state, so a particular key will always return the same value. - /// - public string Code { get; set; } - - /// - /// The location of the key on the device. - /// - public float Location { get; set; } - - /// - /// true if a key has been depressed long enough to trigger key repetition, otherwise false. - /// - public bool Repeat { get; set; } - - /// - /// true if the control key was down when the event was fired. false otherwise. - /// - public bool CtrlKey { get; set; } - - /// - /// true if the shift key was down when the event was fired. false otherwise. - /// - public bool ShiftKey { get; set; } - - /// - /// true if the alt key was down when the event was fired. false otherwise. - /// - public bool AltKey { get; set; } - - /// - /// true if the meta key was down when the event was fired. false otherwise. - /// - public bool MetaKey { get; set; } - } - - /// - /// Supplies information about a mouse event that is being raised. - /// - public class UIMouseEventArgs : UIEventArgs - { - /// - /// A count of consecutive clicks that happened in a short amount of time, incremented by one. - /// - public long Detail { get; set; } - - /// - /// The X coordinate of the mouse pointer in global (screen) coordinates. - /// - public long ScreenX { get; set; } - - /// - /// The Y coordinate of the mouse pointer in global (screen) coordinates. - /// - public long ScreenY { get; set; } - - /// - /// The X coordinate of the mouse pointer in local (DOM content) coordinates. - /// - public long ClientX { get; set; } - - /// - /// The Y coordinate of the mouse pointer in local (DOM content) coordinates. - /// - public long ClientY { get; set; } - - /// - /// The button number that was pressed when the mouse event was fired: - /// Left button=0, - /// middle button=1 (if present), - /// right button=2. - /// For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left. - /// - public long Button { get; set; } - - /// - /// The buttons being pressed when the mouse event was fired: - /// Left button=1, - /// Right button=2, - /// Middle (wheel) button=4, - /// 4th button (typically, "Browser Back" button)=8, - /// 5th button (typically, "Browser Forward" button)=16. - /// If two or more buttons are pressed, returns the logical sum of the values. - /// E.g., if Left button and Right button are pressed, returns 3 (=1 | 2). - /// - public long Buttons { get; set; } - - /// - /// true if the control key was down when the event was fired. false otherwise. - /// - public bool CtrlKey { get; set; } - - /// - /// true if the shift key was down when the event was fired. false otherwise. - /// - public bool ShiftKey { get; set; } - - /// - /// true if the alt key was down when the event was fired. false otherwise. - /// - public bool AltKey { get; set; } - - /// - /// true if the meta key was down when the event was fired. false otherwise. - /// - public bool MetaKey { get; set; } - } - - /// - /// Supplies information about a mouse event that is being raised. - /// - public class UIPointerEventArgs : UIMouseEventArgs - { - /// - /// A unique identifier for the pointer causing the event. - /// - public string PointerId { get; set; } - - /// - /// The width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer. - /// - public float Width { get; set; } - - /// - /// The height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer. - /// - public float Height { get; set; } - - /// - /// The normalized pressure of the pointer input in the range of 0 to 1, - /// where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively. - /// - public float Pressure { get; set; } - - /// - /// The plane angle (in degrees, in the range of -90 to 90) between the Y-Z plane - /// and the plane containing both the transducer (e.g. pen stylus) axis and the Y axis. - /// - public float TiltX { get; set; } - - /// - /// The plane angle (in degrees, in the range of -90 to 90) between the X-Z plane - /// and the plane containing both the transducer (e.g. pen stylus) axis and the X axis. - /// - public float TiltY { get; set; } - - /// - /// Indicates the device type that caused the event. - /// Must be one of the strings mouse, pen or touch, or an empty string. - /// - public string PointerType { get; set; } - - /// - /// Indicates if the pointer represents the primary pointer of this pointer type. - /// - public bool IsPrimary { get; set; } - } - - /// - /// Supplies information about a progress event that is being raised. - /// - public class UIProgressEventArgs : UIEventArgs - { - /// - /// Whether or not the total size of the transfer is known. - /// - public bool LengthComputable { get; set; } - - /// - /// The number of bytes transferred since the beginning of the operation. - /// This doesn't include headers and other overhead, but only the content itself. - /// - public long Loaded { get; set; } - - /// - /// The total number of bytes of content that will be transferred during the operation. - /// If the total size is unknown, this value is zero. - /// - public long Total { get; set; } - } - - /// - /// Supplies information about a touch event that is being raised. - /// - public class UITouchEventArgs : UIEventArgs - { - /// - /// A count of consecutive clicks that happened in a short amount of time, incremented by one. - /// - public long Detail { get; set; } - - /// - /// A list of for every point of contact currently touching the surface. - /// - public UITouchPoint[] Touches { get; set; } - - /// - /// A list of for every point of contact that is touching the surface and started on the element that is the target of the current event. - /// - public UITouchPoint[] TargetTouches { get; set; } - - /// - /// A list of Touches for every point of contact which contributed to the event. - /// For the touchstart event this must be a list of the touch points that just became active with the current event. - /// For the touchmove event this must be a list of the touch points that have moved since the last event. - /// For the touchend and touchcancel events this must be a list of the touch points that have just been removed from the surface. - /// - public UITouchPoint[] ChangedTouches { get; set; } - - /// - /// true if the control key was down when the event was fired. false otherwise. - /// - public bool CtrlKey { get; set; } - - /// - /// true if the shift key was down when the event was fired. false otherwise. - /// - public bool ShiftKey { get; set; } - - /// - /// true if the alt key was down when the event was fired. false otherwise. - /// - public bool AltKey { get; set; } - - /// - /// true if the meta key was down when the event was fired. false otherwise. - /// - public bool MetaKey { get; set; } - } - - /// - /// Represents a single contact point on a touch-sensitive device. - /// The contact point is commonly a finger or stylus and the device may be a touchscreen or trackpad. - /// - public class UITouchPoint - { - /// - /// A unique identifier for this Touch object. - /// A given touch point (say, by a finger) will have the same identifier for the duration of its movement around the surface. - /// This lets you ensure that you're tracking the same touch all the time. - /// - public long Identifier { get; set; } - - /// - /// The X coordinate of the touch point relative to the left edge of the screen. - /// - public long ScreenX { get; set; } - - /// - /// The Y coordinate of the touch point relative to the top edge of the screen. - /// - public long ScreenY { get; set; } - - /// - /// The X coordinate of the touch point relative to the left edge of the browser viewport, not including any scroll offset. - /// - public long ClientX { get; set; } - - /// - /// The Y coordinate of the touch point relative to the top edge of the browser viewport, not including any scroll offset. - /// - public long ClientY { get; set; } - - /// - /// The X coordinate of the touch point relative to the left edge of the document. - /// Unlike , this value includes the horizontal scroll offset, if any. - /// - public long PageX { get; set; } - - /// - /// The Y coordinate of the touch point relative to the top of the document. - /// Unlike , this value includes the vertical scroll offset, if any. - /// - public long PageY { get; set; } - } - - /// - /// Supplies information about a mouse wheel event that is being raised. - /// - public class UIWheelEventArgs : UIMouseEventArgs - { - /// - /// The horizontal scroll amount. - /// - public double DeltaX { get; set; } - - /// - /// The vertical scroll amount. - /// - public double DeltaY { get; set; } - - /// - /// The scroll amount for the z-axis. - /// - public double DeltaZ { get; set; } - - /// - /// The unit of the delta values scroll amount. - /// - public long DeltaMode { get; set; } - } -} diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/UIEventArgsRenderTreeBuilderExtensions.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/UIEventArgsRenderTreeBuilderExtensions.cs deleted file mode 100644 index bc32af071d..0000000000 --- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.ComponentShim/Microsoft.AspNetCore.Components/UIEventArgsRenderTreeBuilderExtensions.cs +++ /dev/null @@ -1,547 +0,0 @@ -// 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.Threading.Tasks; -using Microsoft.AspNetCore.Components.RenderTree; - -namespace Microsoft.AspNetCore.Components -{ - /// - /// Extensions methods on for event handlers. - /// - /// - /// - /// These methods enable method-group to delegate conversion for delegates and methods that accept - /// types derived from . - /// - /// - /// This enhances the programming experience for using event handlers with the render tree builder - /// in components written in pure C#. These extension methods make it possible to write code like: - /// - /// builder.AddAttribute(0, "onkeypress", MyKeyPressHandler); - /// - /// Where void MyKeyPressHandler(UIKeyboardEventArgs e) is a method defined in the same class. - /// In this example, the author knows that the onclick event is associated with the - /// event args type. The component author is responsible for - /// providing a delegate that matches the expected event args type, an error will result in a failure - /// at runtime. - /// - /// - /// When a component is authored in Razor (.cshtml), the Razor code generator will maintain a mapping - /// between event names and event arg types that can be used to generate more strongly typed code. - /// Generated code for the same case will look like: - /// - /// builder.AddAttribute(0, "onkeypress", BindMethods.GetEventHandlerValue<UIKeyboardEventArgs>(MyKeyPressHandler)); - /// - /// - /// - public static class UIEventArgsRenderTreeBuilderExtensions - { - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Action value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Func value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Action value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Func value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Action value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Func value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Action value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Func value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Action value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Func value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Action value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Func value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Action value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Func value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Action value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Func value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Action value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Func value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Action value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Func value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Action value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - - /// - /// - /// Appends a frame representing an -valued attribute. - /// - /// - /// The attribute is associated with the most recently added element. If the value is null and the - /// current element is not a component, the frame will be omitted. - /// - /// - /// The . - /// An integer that represents the position of the instruction in the source code. - /// The name of the attribute. - /// The value of the attribute. - public static void AddAttribute(this RenderTreeBuilder builder, int sequence, string name, Func value) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - builder.AddAttribute(sequence, name, (MulticastDelegate)value); - } - } -} \ No newline at end of file