public static ConnectionType GetConnection(this Account a, Event evt, IDataService ds) { ConnectionType ct = ConnectionType.NoConnection; if (evt.Organizers.Contains(a)) ct |= ConnectionType.Owner; else if (evt.IsOrganizedByFriend(a, ds)) ct |= ConnectionType.Friend; else if (evt.IsOrganizedByFriendOfFriend(a, ds)) ct |= ConnectionType.FriendOfFriend; // TODO: is invited return ct; }