Exemplo n.º 1
0
 public Client(string _login, byte[] _ip, int _port, Connection _C, messageViewer _m)
 {
     login = _login;
     ip    = _ip;
     port  = _port;
     c     = _C;
     m     = _m;
 }
Exemplo n.º 2
0
        public MainWindow(string login, Client cl, double opacity, bool snd, messageViewer _m)
        {
            InitializeComponent();

            myLogin                     = login;
            this.Title                  = "Dixit - " + myLogin;
            client                      = cl;
            client.needExit            += client_needExit;
            client.gameStart           += client_gameStart;
            client.refreshUsersInRooms += client_refreshUsersInRooms;
            client.leaderTurn          += client_leaderTurn;
            client.waiting             += client_waiting;
            client.gamerTurn           += client_gamerTurn;
            client.voatingTurn         += client_voatingTurn;
            client.result              += client_result;
            client.resultChat          += client_resultChat;
            //client.newRound +=client_newRound;
            client.win += client_win;
            client.serverDisconnect += client_serverDisconnect;
            client.chatMsg          += client_chatMsg;
            client.setAdmin         += client_setAdmin;

            player         = new MediaPlayer();
            IsSoundEnabled = snd;
            if (!IsSoundEnabled)
            {
                buttonSoundText.Text = "V";
            }
            m            = _m;
            r            = new rooms(this, opacity);
            r.soundPlay += new EventHandler(r_soundPlay);
            r.Show();
            this.Hide();
            textBoxTask.Visibility = System.Windows.Visibility.Hidden;
            gamers = new List <Gamer>();
            Gamer alone = new Gamer(myLogin, 0);

            GamersdataGrid.Items.Add(alone);
            tag                             = new TextBlock();
            tag.Text                        = "Ожидание начала игры";
            tag.FontWeight                  = FontWeights.Bold;
            tag.FontStyle                   = FontStyles.Italic;
            tag.TextAlignment               = TextAlignment.Center;
            tag.FontSize                    = 14;
            Tag                             = tag;
            userCardsPanel.Visibility       = System.Windows.Visibility.Hidden;
            VoatingPanel.Visibility         = System.Windows.Visibility.Hidden;
            userCardsPanelBorder.Visibility = System.Windows.Visibility.Hidden;
            VoatingPanelBorder.Visibility   = System.Windows.Visibility.Hidden;
            SetCardSample();
            LinearGradientBrush myBrush = new LinearGradientBrush(Colors.PowderBlue, Colors.MediumSlateBlue, 30);

            ImgBrdr.Background               = myBrush;
            VoatingBackgroundBrush.Opacity   = opacity;
            ChatBackgroundBrush.Opacity      = opacity;
            UsersGridBackgroundBrush.Opacity = opacity;
        }
Exemplo n.º 3
0
 public Connection()
 {
     InitializeComponent();
     txt            = new TextBlock();
     txt.FontWeight = FontWeights.Bold;
     txt.Text       = "Здарова!";
     txt.Margin     = new Thickness(-2, 0, 0, 0);
     this.Tag       = txt;
     m      = new messageViewer();
     player = new MediaPlayer();
     //m.Show();
 }
Exemplo n.º 4
0
 public Connection()
 {
     InitializeComponent();
     txt = new TextBlock();
     txt.FontWeight = FontWeights.Bold;
     txt.Text = "Здарова!";
     txt.Margin = new Thickness(-2, 0, 0, 0);
     this.Tag = txt;
     m = new messageViewer();
     player = new MediaPlayer();
     //m.Show();
 }
Exemplo n.º 5
0
        public MainWindow(string login, Client cl, double opacity, bool snd, messageViewer _m)
        {
            InitializeComponent();

            myLogin = login;
            this.Title = "Dixit - " + myLogin;
            client = cl;
            client.needExit += client_needExit;
            client.gameStart += client_gameStart;
            client.refreshUsersInRooms += client_refreshUsersInRooms;
            client.leaderTurn += client_leaderTurn;
            client.waiting += client_waiting;
            client.gamerTurn += client_gamerTurn;
            client.voatingTurn += client_voatingTurn;
            client.result += client_result;
            client.resultChat += client_resultChat;
            //client.newRound +=client_newRound;
            client.win+=client_win;
            client.serverDisconnect += client_serverDisconnect;
            client.chatMsg += client_chatMsg;
            client.setAdmin += client_setAdmin;

            player = new MediaPlayer();
            IsSoundEnabled = snd;
            if (!IsSoundEnabled) buttonSoundText.Text = "V";
            m = _m;
            r = new rooms(this, opacity);
            r.soundPlay += new EventHandler(r_soundPlay);
            r.Show();
            this.Hide();
            textBoxTask.Visibility = System.Windows.Visibility.Hidden;
            gamers = new List<Gamer>();
            Gamer alone = new Gamer(myLogin, 0);
            GamersdataGrid.Items.Add(alone);
            tag = new TextBlock();
            tag.Text = "Ожидание начала игры";
            tag.FontWeight = FontWeights.Bold;
            tag.FontStyle = FontStyles.Italic;
            tag.TextAlignment = TextAlignment.Center;
            tag.FontSize = 14;
            Tag = tag;
            userCardsPanel.Visibility = System.Windows.Visibility.Hidden;
            VoatingPanel.Visibility = System.Windows.Visibility.Hidden;
            userCardsPanelBorder.Visibility = System.Windows.Visibility.Hidden;
            VoatingPanelBorder.Visibility = System.Windows.Visibility.Hidden;
            SetCardSample();
            LinearGradientBrush myBrush = new LinearGradientBrush(Colors.PowderBlue, Colors.MediumSlateBlue, 30);
            ImgBrdr.Background = myBrush;
            VoatingBackgroundBrush.Opacity = opacity;
            ChatBackgroundBrush.Opacity = opacity;
            UsersGridBackgroundBrush.Opacity = opacity;
        }