コード例 #1
0
        public Chat(string user)
        {
            InitializeComponent();

            ChatHost = ClientInstances.Instance.ChatHost;
            GameHost = ClientInstances.Instance.GameHost;

            User                     = user;
            title.Text               = User;
            howToChat.Text           = TopMenu.GetHelpForChat();
            about.Text               = TopMenu.GetAbout();
            titleHours.DataContext   = ClientInstances.Instance.Time;
            titleMinutes.DataContext = ClientInstances.Instance.Time;
            titleSecond.DataContext  = ClientInstances.Instance.Time;

            Timer = new DispatcherTimer
            {
                Interval = TimeSpan.FromHours(1)
            };
            Timer.Start();
            Timer.Tick += Timer_Tick;

            GetDayTime();
            Show();
        }
コード例 #2
0
 public PrivateChat(string user, string opponent)
 {
     InitializeComponent();
     ChatHost                 = ClientInstances.Instance.Chat.ChatHost;
     GameHost                 = ClientInstances.Instance.Chat.GameHost;
     User                     = user;
     Opponent                 = opponent;
     howToChat.Text           = TopMenu.GetHelpForPrChat();
     about.Text               = TopMenu.GetAbout();
     topTitle.Text           += Opponent;
     title.Text              += User;
     titleHours.DataContext   = ClientInstances.Instance.Time;
     titleMinutes.DataContext = ClientInstances.Instance.Time;
     titleSecond.DataContext  = ClientInstances.Instance.Time;
     Show();
 }
コード例 #3
0
        private ClientInstances()
        {
            var callback = new ClientCallback();

            ChatHost = new TalkBackService.ChatServiceClient(new System.ServiceModel.InstanceContext(callback));
            GameHost = new TalkBackService.GameServiceClient(new System.ServiceModel.InstanceContext(callback));

            PrivateChats  = new Dictionary <string, PrivateChat>();
            GameList      = new Dictionary <string, Backgammon>();
            HowFirstsList = new Dictionary <string, HowIsFirst>();
            Time          = new Time();
            TimeTimer     = new DispatcherTimer
            {
                Interval = TimeSpan.FromSeconds(1)
            };
            TimeTimer.Tick += TimeTimer_Tick;
            TimeTimer.Start();
        }