// TODO: change this card! private Attachment CreateTipsForPurposeCard(string purpose) { // TODO: save the purpose var server = ServerMock.GetInstance(); var myContact = server.GetContactByName("shir esh"); Meeting meeting = server.FindNextMeeting(myContact); Contact otherContact = meeting.Attendees.Where(c => c != myContact).FirstOrDefault(); var tips = server.GetTipsAboutPersonForMeeting(meeting, myContact, false); tips = tips.GetRange(2, 2); List <string> tipContents = tips.Select(x => x.Content).ToList(); string concatenedTips = ConcatAllTips(tipContents, ""); var card = new HeroCard //ThumbnailCard { Subtitle = $"Great! For this kind of meeting try to follow these tips:", Text = concatenedTips }; // Create the attachment. Attachment attachment = new Attachment() { ContentType = HeroCard.ContentType, Content = card }; return(attachment); }
private Attachment CreateGeneralMeetingCard(bool isSupposedToStart) { var server = ServerMock.GetInstance(); var myContact = server.GetContactByName("shir esh"); Meeting meeting = server.FindNextMeeting(myContact); Contact otherContact = meeting.Attendees.Where(c => c != myContact).FirstOrDefault(); var tips = server.GetTipsAboutPersonForMeeting(meeting, myContact, isSupposedToStart); if (isSupposedToStart) { tips = tips.GetRange(4, 2); } else { tips = tips.GetRange(0, 2); } List <string> tipContents = tips.Select(x => x.Content).ToList(); string title = isSupposedToStart ? $"Your meeting with {otherContact.Name} is about to start..." : $"Your next meeting is with {otherContact.Name}"; string concatenedTips = ConcatAllTips(tipContents); var linkedinLogo = @"https://theforkliftpro.com/wp-content/uploads/2014/09/linkedin_Icon.png"; var linkedinButton = new CardAction("openUrl", "LinkedIn", value: otherContact.LinkedinPath, image: linkedinLogo); var card = new ThumbnailCard// HeroCard { Title = title, Subtitle = $"Meeting title: {meeting.Title}", Text = concatenedTips, Images = new List <CardImage>() { new CardImage(otherContact.ImagePath) }, Buttons = new List <CardAction>() { linkedinButton } }; // Create the attachment. Attachment attachment = new Attachment() { ContentType = ThumbnailCard.ContentType, Content = card }; return(attachment); }
static void Main(string[] args) { var server = ServerMock.GetInstance(); Contact curContact = server.GetContactByName("shir esh"); string name = curContact.Name; string image = curContact.ImagePath; string linkedin = curContact.LinkedinPath; Meeting meeting = server.FindNextMeeting(curContact); string title = meeting.Title; Console.Read(); }
private Attachment CreateTipsFeedbackCard(string message) { IServer server = ServerMock.GetInstance(); var myContact = server.GetContactByName("shir esh"); var meeting = server.FindNextMeeting(myContact); string title; string subTitle; if (message == MeetingSatisfaction.VeryGood || message == MeetingSatisfaction.Good) { title = "Good to hear!"; subTitle = "Hope my tips were helpful :)"; } else { title = "it can't be that bad..."; subTitle = "Hope that at least my tips were helpful"; } string tip = " <font size=\"3\" color=\"#6699ff\"> <b> " + server.GetGivenTips(meeting, myContact).FirstOrDefault().Content + "</li> </b> </font> "; string text = "So, What do you think about this tip?" + NewLine() + NewLine() + tip + NewLine(); var card = new HeroCard //ThumbnailCard { Title = title, Subtitle = subTitle, Text = text, Buttons = new List <CardAction>() { new CardAction("imBack", "Great Tip!", value: "Great Tip!"), new CardAction("imBack", "You can do better...", value: "You can do better..."), } }; // Create the attachment. Attachment attachment = new Attachment() { ContentType = HeroCard.ContentType, Content = card }; return(attachment); }