public static void ConvertAttachmentContent(this Activity activity) { if (activity == null || activity.Attachments == null) { return; } foreach (var attachment in activity.Attachments) { switch (attachment.ContentType) { case ZoomAttachmentContentTypes.MessageWithLink: SharedAttachmentHelper.Convert <MessageBodyItemWithLink>(attachment); break; case ZoomAttachmentContentTypes.Fields: SharedAttachmentHelper.Convert <FieldsBodyItem>(attachment); break; case ZoomAttachmentContentTypes.Dropdown: SharedAttachmentHelper.Convert <DropdownBodyItem>(attachment); break; case ZoomAttachmentContentTypes.Attachment: SharedAttachmentHelper.Convert <AttachmentBodyItem>(attachment); break; } } }
/// <summary> /// Convert all Alexa specific attachments to their correct type. /// </summary> /// <param name="activity"></param> public static void ConvertAttachmentContent(this Activity activity) { if (activity == null || activity.Attachments == null) { return; } foreach (var attachment in activity.Attachments) { switch (attachment.ContentType) { case HeroCard.ContentType: SharedAttachmentHelper.Convert <HeroCard>(attachment); break; case SigninCard.ContentType: SharedAttachmentHelper.Convert <SigninCard>(attachment); break; case AlexaAttachmentContentTypes.Card: SharedAttachmentHelper.Convert <ICard>(attachment); break; case AlexaAttachmentContentTypes.Directive: SharedAttachmentHelper.Convert <IDirective>(attachment); break; } } }
/// <summary> /// Convert all Actions SDK specific attachments to their correct type. /// </summary> /// <param name="activity"></param> public static void ConvertAttachmentContent(this Activity activity) { if (activity == null || activity.Attachments == null) { return; } foreach (var attachment in activity.Attachments) { switch (attachment.ContentType) { case HeroCard.ContentType: SharedAttachmentHelper.Convert <HeroCard>(attachment); break; case SigninCard.ContentType: SharedAttachmentHelper.Convert <SigninCard>(attachment); break; case ActionsSdkAttachmentContentTypes.Card: SharedAttachmentHelper.Convert <CardContentItem>(attachment); break; case ActionsSdkAttachmentContentTypes.Table: SharedAttachmentHelper.Convert <TableContentItem>(attachment); break; case ActionsSdkAttachmentContentTypes.Media: SharedAttachmentHelper.Convert <MediaContentItem>(attachment); break; case ActionsSdkAttachmentContentTypes.Collection: SharedAttachmentHelper.Convert <CollectionContentItem>(attachment); break; case ActionsSdkAttachmentContentTypes.List: SharedAttachmentHelper.Convert <ListContentItem>(attachment); break; } } }
/// <summary> /// Convert all Google specific attachments to their correct type. /// </summary> /// <param name="activity"></param> public static void ConvertAttachmentContent(this Activity activity) { if (activity == null || activity.Attachments == null) { return; } foreach (var attachment in activity.Attachments) { switch (attachment.ContentType) { case HeroCard.ContentType: SharedAttachmentHelper.Convert <HeroCard>(attachment); break; case SigninCard.ContentType: SharedAttachmentHelper.Convert <SigninCard>(attachment); break; case GoogleAttachmentContentTypes.BasicCard: SharedAttachmentHelper.Convert <BasicCard>(attachment); break; case GoogleAttachmentContentTypes.MediaResponse: SharedAttachmentHelper.Convert <MediaResponse>(attachment); break; case GoogleAttachmentContentTypes.TableCard: SharedAttachmentHelper.Convert <TableCard>(attachment); break; case GoogleAttachmentContentTypes.BrowsingCarousel: SharedAttachmentHelper.Convert <BrowsingCarousel>(attachment); break; case GoogleAttachmentContentTypes.CarouselIntent: SharedAttachmentHelper.Convert <CarouselIntent>(attachment); break; case GoogleAttachmentContentTypes.ListIntent: SharedAttachmentHelper.Convert <ListIntent>(attachment); break; case GoogleAttachmentContentTypes.DateTimeIntent: SharedAttachmentHelper.Convert <DateTimeIntent>(attachment); break; case GoogleAttachmentContentTypes.PermissionsIntent: SharedAttachmentHelper.Convert <PermissionsIntent>(attachment); break; case GoogleAttachmentContentTypes.PlaceLocationIntent: SharedAttachmentHelper.Convert <PlaceLocationIntent>(attachment); break; case GoogleAttachmentContentTypes.ConfirmationIntent: SharedAttachmentHelper.Convert <ConfirmationIntent>(attachment); break; case GoogleAttachmentContentTypes.NewSurfaceIntent: SharedAttachmentHelper.Convert <NewSurfaceIntent>(attachment); break; case GoogleAttachmentContentTypes.SigninIntent: SharedAttachmentHelper.Convert <SigninIntent>(attachment); break; } } }