Example #1
0
        public void RegisterClient()
        {
            if ((this._client != null))
            {
                this._client.Abort();
                this._client = null;
            }

            //ServiceCallBack cb = new ServiceCallBack();
            ServiceCallBack cb = this;

            cb.SetHandler(this.HandleBroadcast);

            System.ServiceModel.InstanceContext context =
                new System.ServiceModel.InstanceContext(cb);
            this._client = new OnlineLearningCardService.LearningCardServiceClient(context);
            try
            {
                this._client.RegisterClient(GlobalProfile.Instance.ActiveProfile.Name);
            }
            catch (EndpointNotFoundException)
            {
                System.Windows.Forms.MessageBox.Show(Model.GlobalLanguage.Instance.GetDict()["CouldNotConnectToTheServer"],
                                                     Model.GlobalLanguage.Instance.GetDict()["None"],
                                                     System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation);
                return;
            }
        }
Example #2
0
 public OnlineGameModel(OnlineLearningCardService.LearningCardServiceClient client)
 {
     this._client   = client;
     this.QuizPhase = AnswerPhase.CkeckAnswer;
     this.SetupNewCard();
 }