microsoft/teams.net

Public

mirrored from https://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
samples/migration-bot

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.Api/Activities/Events/EventActivity.cs

28lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3
4using System.Text.Json.Serialization;
5
6using Microsoft.Teams.Common;
7
8namespace Microsoft.Teams.Api.Activities.Events;
9
10[JsonConverter(typeof(JsonConverter<Name>))]
11public partial class Name(string value) : StringEnum(value)
12{
13 public Type ToType()
14 {
15 if (IsReadReceipt) return typeof(ReadReceiptActivity);
16 if (IsMeetingStart) return typeof(MeetingStartActivity);
17 if (IsMeetingEnd) return typeof(MeetingEndActivity);
18 if (IsMeetingParticipantJoin) return typeof(MeetingParticipantJoinActivity);
19 if (IsMeetingParticipantLeave) return typeof(MeetingParticipantLeaveActivity);
20 return typeof(EventActivity);
21 }
22
23 public string ToPrettyString()
24 {
25 var value = ToString();
26 return $"{value.First().ToString().ToUpper()}{value.AsSpan(1).ToString()}";
27 }
28}