private void buttonTest_Click(object sender, RoutedEventArgs e)
        {
#if !DEMO
            this.Dispatcher.Invoke((Action)(() =>
            {
                if (BroadcastClientSocket.IsConnected &&
                    BroadcastServerSocket.IsRunning)
                {
                    BroadcastClientSocket.ReceivedMessage +=
                        BroadcastClientSocket_ReceivedMessage;
                    BroadcastServerSocket.BroadcastMessage(Strings.Test);
                }
                else if (!BroadcastServerSocket.IsRunning)
                {
                    PosDialogWindow.ShowDialog(
                        Strings.ServerIsNotRunning, Strings.TestFailed);
                }
                else // if (!BroadcastClientSocket.IsConnected)
                {
                    PosDialogWindow.ShowDialog(
                        Strings.ClientIsNotRunning, Strings.TestFailed);
                }
            }));
#endif
        }
        private void textBoxPort_CommitEdit(object sender, EventArgs e)
        {
            // Broadcast Server
#if !DEMO
            BroadcastServerSocket.Port = GetPort();
            if ((BroadcastServerSocket.IsEnabled) &&
                (BroadcastServerSocket.Port != null))
            {
                if (BroadcastServerSocket.IsRunning)
                {
                    BroadcastServerSocket.BroadcastMessage("ServerPortMayHaveChanged");
                    BroadcastServerSocket.Stop();
                }
                BroadcastServerSocket.Start();
            }
#endif
        }