public GuardBuy(BiliLiveJsonParser.GuardBuy guardBuy) { InitializeComponent(); UserBox.Text = guardBuy.User.Name; TitleBox.Text = guardBuy.GiftName; switch (guardBuy.GuardLevel) { case 1: InfoGrid.Background = GovernorBrush; break; case 2: InfoGrid.Background = AdmiralBrush; break; case 3: InfoGrid.Background = CaptainBrush; break; } UserId = guardBuy.User.Id; FaceImage.Source = null; //BitmapImage bitmapImage = FaceLoader.LoadFormCache(UserId); //FaceImage.Source = bitmapImage; //if (!FaceLoader.LoadFormCache(this)) // //SetFace(bitmapImage); // //if(bitmapImage == null) // FaceLoader.Enqueue(this); FaceLoader.LoadFace(this); }
public Welcome(BiliLiveJsonParser.Welcome welcome) { InitializeComponent(); UserBox.Text = welcome.User.Name; if (welcome.Svip) { TitleBox.Text = "年费老爷"; UserBox.Foreground = SvipBrush; TitleBox.Foreground = SvipBrush; } else { TitleBox.Text = "老爷"; UserBox.Foreground = VipBrush; TitleBox.Foreground = VipBrush; } UserId = welcome.User.Id; FaceImage.Source = null; //BitmapImage bitmapImage = FaceLoader.LoadFormCache(UserId); //FaceImage.Source = bitmapImage; //if (!FaceLoader.LoadFormCache(this)) // //SetFace(bitmapImage); // //if(bitmapImage == null) // FaceLoader.Enqueue(this); FaceLoader.LoadFace(this); }
public SuperChat(BiliLiveJsonParser.SuperChat superChat) { InitializeComponent(); SenderBox.Text = superChat.User.Name; PriceBox.Text = superChat.Price.ToString(); MessageBox.Text = superChat.Message; if (superChat.TransMark) { MessageTransBox.Text = superChat.MessageTrans; } else { MessageTransBorder.Visibility = Visibility.Collapsed; } InfoGrid.Background = new SolidColorBrush(superChat.PriceColor); MessageStackPanel.Background = new SolidColorBrush(superChat.BottomColor); UserId = superChat.User.Id; FaceImage.Source = null; //FaceImage.Source = FaceLoader.LoadFace(superChat.User.Id, superChat.Face); FaceLoader.LoadFaceWithKnownUri(this, superChat.Face); }
public Gift(GiftCacheManager.GiftCache giftCache) { InitializeComponent(); SenderBox.Text = giftCache.Username; ActionBox.Text = giftCache.Action; GiftBox.Text = giftCache.GiftName; if (giftCache.CoinType == "gold") { // "gold" GiftBox.Foreground = GoldBrush; } else { // "silver" GiftBox.Foreground = SilverBrush; } Number = giftCache.Number; UserId = giftCache.UserId; FaceImage.Source = null; //FaceImage.Source = FaceLoader.LoadFace(gift.Sender.Id, gift.FaceUri); FaceLoader.LoadFaceWithKnownUri(this, giftCache.FaceUri); giftCache.Updated += GiftCache_GiftUpdated; }
public Gift(BiliLiveJsonParser.Gift gift) { InitializeComponent(); SenderBox.Text = gift.Sender.Name; ActionBox.Text = gift.Action; GiftBox.Text = gift.GiftName; if (gift.CoinType == "gold") { // "gold" GiftBox.Foreground = GoldBrush; } else { // "silver" GiftBox.Foreground = SilverBrush; } Number = gift.Number; UserId = gift.Sender.Id; FaceImage.Source = null; //FaceImage.Source = FaceLoader.LoadFace(gift.Sender.Id, gift.FaceUri); FaceLoader.LoadFaceWithKnownUri(this, gift.FaceUri); }
public InteractWord(BiliLiveJsonParser.InteractWord interactWord) { InitializeComponent(); UserBox.Text = interactWord.User.Name; switch (interactWord.MessageType) { case BiliLiveJsonParser.InteractWord.MessageTypes.Entry: bool isGuard = false; foreach (BiliLiveJsonParser.InteractWord.Identities identity in interactWord.Identity) { if ((int)identity >= (int)BiliLiveJsonParser.InteractWord.Identities.GuardJian) { isGuard = true; break; } } if (isGuard) { InteractWordBox.Text = "光临直播间"; } else { InteractWordBox.Text = "进入直播间"; } InteractWordBox.Foreground = SilverBrush; break; case BiliLiveJsonParser.InteractWord.MessageTypes.Attention: InteractWordBox.Text = "关注了直播间"; InteractWordBox.Foreground = GoldBrush; break; case BiliLiveJsonParser.InteractWord.MessageTypes.Share: InteractWordBox.Text = "分享了直播间"; InteractWordBox.Foreground = GoldBrush; break; case BiliLiveJsonParser.InteractWord.MessageTypes.SpecialAttention: InteractWordBox.Text = "特别关注了直播间"; InteractWordBox.Foreground = GoldBrush; break; case BiliLiveJsonParser.InteractWord.MessageTypes.MutualAttention: InteractWordBox.Text = "互粉了直播间"; InteractWordBox.Foreground = GoldBrush; break; } UserId = interactWord.User.Id; FaceImage.Source = null; FaceLoader.LoadFace(this); }
public ComboSend(BiliLiveJsonParser.ComboSend comboSend) { InitializeComponent(); SenderBox.Text = comboSend.Sender.Name; ActionBox.Text = comboSend.Action; GiftBox.Text = comboSend.GiftName; NumBox.Text = comboSend.Number.ToString(); UserId = comboSend.Sender.Id; GiftId = comboSend.GiftId; FaceImage.Source = null; //FaceImage.Source = FaceLoader.LoadFace(gift.Sender.Id, gift.FaceUri); FaceLoader.LoadFace(this); }
public Danmaku(BiliLiveJsonParser.Danmaku danmaku) { InitializeComponent(); SenderBox.Text = danmaku.Sender.Name; MessageBox.Text = danmaku.Message; UserId = danmaku.Sender.Id; FaceImage.Source = null; //BitmapImage bitmapImage = FaceLoader.LoadFormCache(UserId); //FaceImage.Source = bitmapImage; //if (!FaceLoader.LoadFormCache(this)) // //SetFace(bitmapImage); // //if(bitmapImage == null) // FaceLoader.Enqueue(this); FaceLoader.LoadFace(this); }
public Welcome(BiliLiveJsonParser.WelcomeGuard welcomeGuard) { InitializeComponent(); UserBox.Text = welcomeGuard.User.Name; switch (welcomeGuard.GuardLevel) { case 1: TitleBox.Text = "总督"; UserBox.Foreground = GovernorBrush; TitleBox.Foreground = GovernorBrush; break; case 2: TitleBox.Text = "提督"; UserBox.Foreground = AdmiralBrush; TitleBox.Foreground = AdmiralBrush; break; case 3: TitleBox.Text = "舰长"; UserBox.Foreground = CaptainBrush; TitleBox.Foreground = CaptainBrush; break; } UserId = welcomeGuard.User.Id; FaceImage.Source = null; //BitmapImage bitmapImage = FaceLoader.LoadFormCache(UserId); //FaceImage.Source = bitmapImage; //if (!FaceLoader.LoadFormCache(this)) // //SetFace(bitmapImage); // //if(bitmapImage == null) // FaceLoader.Enqueue(this); FaceLoader.LoadFace(this); }