protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); NavigationMode = e.NavigationMode; if (e.NavigationMode == NavigationMode.New) { GetType().RemovePageFromBackStack(); try { LVPosts.ItemsSource = null; } catch { } } try { if (e.Parameter != null && e.Parameter is object[] obj && obj?.Length == 3) { if (obj[0] is InstaUserInfo userInfo) { User = userInfo; } if (obj[1] is UserDetailsMediasGenerator generator) { MediaGeneratror = generator; } SelectedIndex = (int)obj[2]; } } catch { } }
private Result <InstaUserInfo> CreateReturnResultUserInfo() { var returnUser = new InstaUserInfo { Username = userName, Pk = userId, IsPrivate = false }; return(new Result <InstaUserInfo>(true, returnUser)); }
public static InstaUserShort ToUserShort(this InstaUserInfo userInfo) { return(new InstaUserShort { IsPrivate = userInfo.IsPrivate, IsVerified = userInfo.IsVerified, FullName = userInfo.FullName, UserName = userInfo.UserName, Pk = userInfo.Pk, ProfilePictureId = userInfo.ProfilePictureId, ProfilePicUrl = userInfo.ProfilePicUrl, ProfilePicture = userInfo.ProfilePicture, HasAnonymousProfilePicture = userInfo.HasAnonymousProfilePicture }); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.NavigationMode == NavigationMode.New) { GetType().RemovePageFromBackStack(); } try { if (e.Parameter != null && e.Parameter is InstaInboxMedia media) { Media = media; } else if (e.Parameter != null && e.Parameter is InstaUserInfo userInfo) { User = userInfo; } } catch { } }
public UserProfileMenusDialog(InstaUserInfo userInfo, InstaStoryFriendshipStatus friendshipStatus) { this.InitializeComponent(); User = userInfo; FriendshipStatus = friendshipStatus; LVMenu.Items.Add(new MenuClass { Command = CommandType.SendMessage, Text = "Send message" }); if (FriendshipStatus != null) { if (FriendshipStatus.Blocking) { LVMenu.Items.Add(new MenuClass { Command = CommandType.Unblock, Text = "Unblock" }); } else { LVMenu.Items.Add(new MenuClass { Command = CommandType.Block, Text = "Block" }); } } LVMenu.Items.Add(new MenuClass { Command = CommandType.DownloadProfilePicture, Text = "Download profile picture" }); if (FriendshipStatus != null) { if (FriendshipStatus.IsBlockingReel) { LVMenu.Items.Add(new MenuClass { Command = CommandType.ShowYourStory, Text = "Show Your Story" }); } else { LVMenu.Items.Add(new MenuClass { Command = CommandType.HideYourStory, Text = "Hide Your Story" }); } if (FriendshipStatus.FollowedBy || FriendshipStatus.Following) { if (FriendshipStatus.Muting) { LVMenu.Items.Add(new MenuClass { Command = CommandType.UnMute, Text = "Unmute" }); } else { LVMenu.Items.Add(new MenuClass { Command = CommandType.Mute, Text = "Mute" }); } } } LVMenu.Items.Add(new MenuClass { Command = CommandType.CopyUsername, Text = "Copy username" }); LVMenu.Items.Add(new MenuClass { Command = CommandType.CopyUsernameAddress, Text = "Copy username address" }); LVMenu.Items.Add(new MenuClass { Command = CommandType.ShareThisProfile, Text = "Share this profile" }); LVMenu.Items.Add(new MenuClass { Command = CommandType.Cancel, Text = "Cancel" }); }
public async Task <int> AddOrUpdate(string originalChannelId, string channelId, InstaUserInfo channel) { using (var uow = this.CreateWithDisabledLazyLoading()) { var channelsRep = uow.GetRepository <ChannelEntity>(); var entity = this.mapper.Map <ChannelEntity>(channel); entity.OriginalChannelId = originalChannelId; entity.ChannelId = channelId; var metadata = await this.GetTransferMetadata(originalChannelId, channelId); if (metadata == null) { await channelsRep.AddAsync(entity); } else { entity.Id = metadata.Id; entity.CreatedAt = metadata.CreatedAt; channelsRep.Update(entity); } await uow.SaveAsync(); return(entity.Id); } }