Skip to content

Instantly share code, notes, and snippets.

View winstongubantes's full-sized avatar

Winston Gubantes winstongubantes

View GitHub Profile
@winstongubantes
winstongubantes / Messagescontroller.cs
Last active February 1, 2017 14:09
MessageController
[BotAuthentication]
public class MessagesController : ApiController
{
public async Task<HttpResponseMessage> Post([FromBody]Activity activity)
{
ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl));
if (activity.Type == ActivityTypes.Message)
{
// calculate something for us to return
int length = (activity.Text ?? string.Empty).Length;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.FormFlow;
using Microsoft.Bot.Builder.Luis;
using Microsoft.Bot.Builder.Luis.Models;
using Microsoft.Bot.Builder.Resource;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.FormFlow;
using Microsoft.Bot.Builder.Luis;
using Microsoft.Bot.Builder.Luis.Models;
using Microsoft.Bot.Builder.Resource;
<? xml version = "1.0" encoding = "utf-8" ?>
< !--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301879
-->
< configuration >
< appSettings >
< !--update these with your appid and one of your appsecret keys-->
< add key = "MicrosoftAppId" value = "[GUID]" />
< add key = "MicrosoftAppPassword" value = "[PASSWORD]" />
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MyApp"
x:Class="MyApp.MainPage">
<ContentPage.Content>
<Grid>
<Image Source="background.png" Aspect="AspectFill"></Image>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace TravelAppMobile.Models
{
public class MessageSet
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace TravelAppMobile.Models
{
public class ConversationMessage
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using TravelAppMobile.Models;
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:viewModels="clr-namespace:TravelAppMobile.ViewModels;assembly=TravelAppMobile"
x:Class="TravelAppMobile.Pages.TravelAgentPage"
Title="Travel Agent">
<ContentPage.BindingContext>
<viewModels:TravelAgentPageViewModel></viewModels:TravelAgentPageViewModel>
</ContentPage.BindingContext>
<ContentPage.Content>
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:viewModels="clr-namespace:ConversationApp.ViewModels;assembly=ConversationApp"
x:Class="ConversationApp.Pages.ConversationPage">
<ContentPage.BindingContext>
<viewModels:ConversationPageViewModel></viewModels:ConversationPageViewModel>
</ContentPage.BindingContext>
<ContentPage.Content>
<StackLayout Orientation="Vertical"