コード例 #1
0
        private Attachment GetVideoPromptMessage()
        {
            MRBuddyConstants    _mrBuddyConstants      = new MRBuddyConstants();
            MediaCardProperties mediaCardPropertiesObj = new MediaCardProperties();
            Media_Cards         _mediaCardObj          = new Media_Cards();
            Attachment          videoAttachment        = new Attachment();;

            if (SelectedExamcardQuery.Contains("create"))
            {
                mediaCardPropertiesObj.CardTitle    = "Create ExamCard Video";
                mediaCardPropertiesObj.CardSubtitle = "This is the Sample video of how to create ExamCard";
                mediaCardPropertiesObj.CardText     = _mrBuddyConstants.CreateExamCardteVideoPath;
                mediaCardPropertiesObj.URL          = _mrBuddyConstants.CreateExamCardteVideoPath;
            }
            if (SelectedExamcardQuery.Contains("import"))
            {
                mediaCardPropertiesObj.CardTitle    = "Import ExamCard Video";
                mediaCardPropertiesObj.CardSubtitle = "This is the Sample video of how to Import ExamCard";
                mediaCardPropertiesObj.CardText     = _mrBuddyConstants.ImportExamCardVideoPath;
                mediaCardPropertiesObj.URL          = _mrBuddyConstants.ImportExamCardVideoPath;
            }
            if (SelectedExamcardQuery.Contains("export"))
            {
                mediaCardPropertiesObj.CardTitle    = "Export ExamCard Video";
                mediaCardPropertiesObj.CardSubtitle = "This is the Sample video of how to Export ExamCard";
                mediaCardPropertiesObj.CardText     = _mrBuddyConstants.ExportExamImportVideoPath;
                mediaCardPropertiesObj.URL          = _mrBuddyConstants.ExportExamImportVideoPath;
            }

            videoAttachment = _mediaCardObj.VideoAttachment(mediaCardPropertiesObj);
            return(videoAttachment);
        }
コード例 #2
0
        private Attachment GetDocumentPromptMessage()
        {
            MRBuddyConstants    _mrBuddyConstants      = new MRBuddyConstants();
            MediaCardProperties mediaCardPropertiesObj = new MediaCardProperties();
            Media_Cards         _mediaCardObj          = new Media_Cards();
            Attachment          docAttachment          = new Attachment();;

            if (SelectedExamcardQuery.Contains("create"))
            {
                mediaCardPropertiesObj.CardTitle    = "Create ExamCard Helpdoc";
                mediaCardPropertiesObj.CardSubtitle = "This is help document on how to Create ExamCard";
                mediaCardPropertiesObj.URL          = _mrBuddyConstants.CreateExamCardDOCPath;
            }
            if (SelectedExamcardQuery.Contains("import"))
            {
                mediaCardPropertiesObj.CardTitle    = "Import ExamCard Helpdoc";
                mediaCardPropertiesObj.CardSubtitle = "This is help document on how to Import ExamCard";
                mediaCardPropertiesObj.URL          = _mrBuddyConstants.ImportExamCardDOCPath;
            }
            if (SelectedExamcardQuery.Contains("export"))
            {
                mediaCardPropertiesObj.CardTitle    = "Export ExamCard Helpdoc";
                mediaCardPropertiesObj.CardSubtitle = "This is help document on how to Import ExamCard";
                mediaCardPropertiesObj.URL          = _mrBuddyConstants.ExportExamImportDOCPath;
            }

            docAttachment = _mediaCardObj.FileAttachment(mediaCardPropertiesObj);
            return(docAttachment);
        }
コード例 #3
0
        private async Task <DialogTurnResult> ViewHelp(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            var         message     = stepContext.Context.Activity.Text.ToLower();
            Media_Cards media_Cards = new Media_Cards();

            if (message.Contains("video"))
            {
                var attachment    = GetVideoPromptMessage();
                var promptMessage = (Activity)MessageFactory.Attachment(attachment);
                await stepContext.Context.SendActivityAsync(promptMessage, cancellationToken);
            }
            else if (message.Contains("document"))
            {
                var attachment    = GetDocumentPromptMessage();
                var promptMessage = (Activity)MessageFactory.Attachment(attachment);
                await stepContext.Context.SendActivityAsync(promptMessage, cancellationToken);
            }

            return(await stepContext.NextAsync(null, cancellationToken));
        }