ICardActionHandlerICardActionHandler

public interface ICardActionHandler : IJavaObject 

NamespaceNamespace

namespace AdaptiveCards.Rendering.Xamarin.Android.Renderer.ActionHandler

요약Summary

public 메서드Public methods
abstract void OnAction (BaseActionElement p0, RenderedAdaptiveCard p1)
abstract void OnMediaPlay (BaseCardElement p0, RenderedAdaptiveCard p1)
abstract void OnMediaStop (BaseCardElement p0, RenderedAdaptiveCard p1)

공용 메서드Public Methods


OnActionOnAction

버전 0.1.0에 추가 됨Added in version 0.1.0

void OnAction (BaseActionElement p0, RenderedAdaptiveCard p1)

OpenUrlAction, SubmitAction 또는 ShowCardAction (인라인이 아닌 경우)를 클릭할 때 호출 되는 수신기입니다.Listener called when a OpenUrlAction, SubmitAction or ShowCardAction (if not inline) are clicked.

매개 변수Parameters
p0p0 AdaptiveCards.Rendering.Xamarin.Android.ObjectModel.BaseActionElement
p1p1 AdaptiveCards.Rendering.Xamarin.Android.Renderer.RenderedAdaptiveCard

샘플Sample

public class MyCardActionHandler : ICardActionHandler
{

    public void OnAction(BaseActionElement element, RenderedAdaptiveCard renderedCard)
    {
        ActionType actionType = element.ElementType;
        if (actionType == ActionType.Submit)
        {
            var inputs = renderedCard.Inputs;
            string inputValues = string.Empty;
            foreach (var inputString in inputs)
            {
                inputValues += $"{{{inputString.Key} : {inputString.Value}}}\n";
            }
            submitData(inputValues);
        }
        else if (actionType == ActionType.ShowCard)
        {
            var showcardAction = ShowCardAction.Dynamic_cast(element);
            showCard(showcardAction.Card)
        }
        else if (actionType == ActionType.OpenUrl)
        {
            var openUrlAction = OpenUrlAction.Dynamic_cast(element);
            openUrl(openUrlAction.Url);
        }
    }
}

OnMediaPlayOnMediaPlay

버전 0.1에 추가 됨Added in version 0.1

void OnMediaPlay (BaseCardElement p0, RenderedAdaptiveCard p1)

미디어 요소의 재생을 시작할 때 호출 되는 수신기입니다.Listener called when the media element starts playing.

매개 변수Parameters
p0p0 AdaptiveCards.Rendering.Xamarin.Android.ObjectModel.BaseCardElement
p1p1 AdaptiveCards.Rendering.Xamarin.Android.Renderer.RenderedAdaptiveCard

샘플Sample

public class MyCardActionHandler : ICardActionHandler
{
    public void OnMediaPlay(BaseCardElement element, RenderedAdaptiveCard renderedCard)
    {
    }
}

OnMediaStopOnMediaStop

버전 0.1에 추가 됨Added in version 0.1

void OnMediaStop (BaseCardElement p0, RenderedAdaptiveCard p1)

미디어 요소가 재생을 중지할 때 호출 되는 수신기입니다.Listener called when the media element stops playing.

매개 변수Parameters
p0p0 AdaptiveCards.Rendering.Xamarin.Android.ObjectModel.BaseCardElement
p1p1 AdaptiveCards.Rendering.Xamarin.Android.Renderer.RenderedAdaptiveCard

샘플Sample

public class MyCardActionHandler : ICardActionHandler
{
    public void OnMediaStop(BaseCardElement element, RenderedAdaptiveCard renderedCard)
    {
    }
}