|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Shapes;
- using Protobuf;
-
- namespace Client
- {
- /// <summary>
- /// StatusBarOfCircumstance.xaml 的交互逻辑
- /// </summary>
- public partial class StatusBarOfCircumstance : UserControl
- {
- public StatusBarOfCircumstance(Grid parent, int Row, int Column)
- {
- InitializeComponent();
- parent.Children.Add(this);
- Grid.SetColumn(this, Column);
- Grid.SetColumnSpan(this, 2);
- Grid.SetRow(this, Row);
- Grid.SetRowSpan(this, 2);
- }
- public void SetFontSize(double fontsize)
- {
- status.FontSize = 13 * fontsize / 12;
- time.FontSize = 13 * fontsize / 12;
- scoresOfStudents.FontSize = scoresOfTrickers.FontSize = fontsize;
- }
-
- public void SetValue(MessageOfAll obj)
- {
- time.Text = "Time⏳: " + Convert.ToString(obj.GameTime);
- status.Text = "📱: " + Convert.ToString(obj.SubjectLeft) + "\n🚪: ";
- if(obj.GateOpened)
- {
- status.Text += "Open\n🆘: ";
- }
- else
- {
- status.Text += "Close\n🆘: ";
- }
- if(obj.HiddenGateRefreshed)
- {
- if(obj.HiddenGateOpened)
- {
- status.Text += "Open\n🏃: ";
- }
- else
- {
- status.Text += "Refreshed\n🏃: ";
- }
- }
- else
- {
- status.Text += "Unrefreshed\n🏃: ";
- }
- status.Text += Convert.ToString(obj.StudentGraduated)+ "\n⚰️: ";
- status.Text += Convert.ToString(obj.StudentQuited);
- scoresOfStudents.Text = "Scores of Students:" + Convert.ToString(obj.StudentScore);
- scoresOfTrickers.Text = "Scores of Tricker:" + Convert.ToString(obj.TrickerScore);
- }
- }
- }
|