示例#1
0
        protected async Task OnMouseUpAsync(MouseEventArgs args)
        {
            await ChangeValue();

            if (OnMouseUp.HasDelegate)
            {
                await OnMouseUp.InvokeAsync(args);
            }
        }
示例#2
0
        protected async Task OnMouseUpAsync(MouseEventArgs args)
        {
            if (!EqualityComparer <TValue> .Default.Equals(CurrentValue, _inputValue))
            {
                if (!_compositionInputting)
                {
                    CurrentValue = _inputValue;
                    if (OnChange.HasDelegate)
                    {
                        await OnChange.InvokeAsync(Value);
                    }
                }
            }

            if (OnMouseUp.HasDelegate)
            {
                await OnMouseUp.InvokeAsync(args);
            }
        }
示例#3
0
 protected virtual Task HandleMouseUp(MouseEventArgs args)
 {
     return(OnMouseUp.InvokeAsync(args));
 }
示例#4
0
        public override async Task EventCallback(string eventName, string eventJson)
        {
            var jsonOptions = new JsonSerializerOptions {
                PropertyNamingPolicy = JsonNamingPolicy.CamelCase
            };

            switch (eventName)
            {
            case "OnDidCompositionEnd":
                await OnDidCompositionEnd.InvokeAsync(this);

                break;

            case "OnDidCompositionStart":
                await OnDidCompositionStart.InvokeAsync(this);

                break;

            case "OnContextMenu":
                if (eventJson != null)
                {
                    await OnContextMenu.InvokeAsync(
                        JsonSerializer.Deserialize <EditorMouseEvent>(eventJson, jsonOptions));
                }
                break;

            case "OnDidBlurEditorText":
                await OnDidBlurEditorText.InvokeAsync(this);

                break;

            case "OnDidBlurEditorWidget":
                await OnDidBlurEditorWidget.InvokeAsync(this);

                break;

            case "OnDidChangeConfiguration":
                await OnDidChangeConfiguration.InvokeAsync(this);

                break;

            case "OnDidChangeCursorPosition":
                await OnDidChangeCursorPosition.InvokeAsync(
                    JsonSerializer.Deserialize <CursorPositionChangedEvent>(eventJson, jsonOptions));

                break;

            case "OnDidChangeCursorSelection":
                await OnDidChangeCursorSelection.InvokeAsync(
                    JsonSerializer.Deserialize <CursorSelectionChangedEvent>(eventJson, jsonOptions));

                break;

            case "OnDidChangeModel":
                await OnDidChangeModel.InvokeAsync(
                    JsonSerializer.Deserialize <ModelChangedEvent>(eventJson, jsonOptions));

                break;

            case "OnDidChangeModelContent":
                await OnDidChangeModelContent.InvokeAsync(
                    JsonSerializer.Deserialize <ModelContentChangedEvent>(eventJson, jsonOptions));

                break;

            case "OnDidChangeModelDecorations":
                await OnDidChangeModelDecorations.InvokeAsync(
                    JsonSerializer.Deserialize <ModelDecorationsChangedEvent>(eventJson, jsonOptions));

                break;

            case "OnDidChangeModelLanguage":
                await OnDidChangeModelLanguage.InvokeAsync(
                    JsonSerializer.Deserialize <ModelLanguageChangedEvent>(eventJson, jsonOptions));

                break;

            case "OnDidChangeModelLanguageConfiguration":
                await OnDidChangeModelLanguageConfiguration.InvokeAsync(
                    JsonSerializer.Deserialize <ModelLanguageConfigurationChangedEvent>(eventJson, jsonOptions));

                break;

            case "OnDidChangeModelOptions":
                await OnDidChangeModelOptions.InvokeAsync(
                    JsonSerializer.Deserialize <ModelOptionsChangedEvent>(eventJson, jsonOptions));

                break;

            case "OnDidContentSizeChange":
                await OnDidContentSizeChange.InvokeAsync(
                    JsonSerializer.Deserialize <ContentSizeChangedEvent>(eventJson, jsonOptions));

                break;

            case "OnDidFocusEditorText":
                await OnDidFocusEditorText.InvokeAsync(this);

                break;

            case "OnDidFocusEditorWidget":
                await OnDidFocusEditorWidget.InvokeAsync(this);

                break;

            case "OnDidLayoutChange":
                if (eventJson != null)
                {
                    await OnDidLayoutChange.InvokeAsync(
                        JsonSerializer.Deserialize <EditorLayoutInfo>(eventJson, jsonOptions));
                }
                break;

            case "OnDidPaste":
                if (eventJson != null)
                {
                    await OnDidPaste.InvokeAsync(JsonSerializer.Deserialize <PasteEvent>(eventJson, jsonOptions));
                }
                break;

            case "OnDidScrollChange":
                if (eventJson != null)
                {
                    await OnDidScrollChange.InvokeAsync(
                        JsonSerializer.Deserialize <ScrollEvent>(eventJson, jsonOptions));
                }
                break;

            case "OnKeyDown":
                if (eventJson != null)
                {
                    await OnKeyDown.InvokeAsync(JsonSerializer.Deserialize <KeyboardEvent>(eventJson, jsonOptions));
                }
                break;

            case "OnKeyUp":
                if (eventJson != null)
                {
                    await OnKeyUp.InvokeAsync(JsonSerializer.Deserialize <KeyboardEvent>(eventJson, jsonOptions));
                }
                break;

            case "OnMouseDown":
                if (eventJson != null)
                {
                    await OnMouseDown.InvokeAsync(
                        JsonSerializer.Deserialize <EditorMouseEvent>(eventJson, jsonOptions));
                }
                break;

            case "OnMouseLeave":
                if (eventJson != null)
                {
                    await OnMouseLeave.InvokeAsync(
                        JsonSerializer.Deserialize <EditorMouseEvent>(eventJson, jsonOptions));
                }
                break;

            case "OnMouseMove":
                if (eventJson != null)
                {
                    await OnMouseMove.InvokeAsync(
                        JsonSerializer.Deserialize <EditorMouseEvent>(eventJson, jsonOptions));
                }
                break;

            case "OnMouseUp":
                if (eventJson != null)
                {
                    await OnMouseUp.InvokeAsync(
                        JsonSerializer.Deserialize <EditorMouseEvent>(eventJson, jsonOptions));
                }
                break;
            }

            await base.EventCallback(eventName, eventJson);
        }