コード例 #1
0
ファイル: Server.cs プロジェクト: kamiln60/grapsw-dooble
        public static Server GetInstance()
        {
            if (instance == null)
            {
                InstanceContext ctx = new InstanceContext(DobbleServerCallback.GetInstance());
                instance = new Server(ctx);
                //MessageBox.Show("Interfejs do serwera utworzony");
            }

            return(instance);
        }
コード例 #2
0
        public static DobbleServerCallback GetInstance()
        {
            if (instance == null)
            {
                instance = new DobbleServerCallback();
                // MessageBox.Show("Instancja callbacka zrobiona");
            }


            return(instance);
        }
コード例 #3
0
        public MainWindow()
        {
            InitializeComponent();
            Page1 p1 = new Page1();

            myframe.NavigationService.Navigate(p1);
            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            this._server  = Server.GetInstance();
            this.newTable = new NewTable(this);
            DobbleServerCallback.GetInstance().VisitMainWindow(this);
            DobbleServerCallback.GetInstance().VisitNewTable(newTable);
        }
コード例 #4
0
        private void Exit(object sender, RoutedEventArgs e)
        {
            DobbleServerCallback.GetInstance().VisitNewTable(this);
            if (_server == null)
            {
                new Thread(() => MessageBox.Show("BŁĄD! SERWER NULL :o")).Start();
            }

            _server.BeginDisconnect(_server.Token, ExitCallback, null);
            Page1 p1 = new Page1();

            this.NavigationService.Navigate(p1);
        }
コード例 #5
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     DobbleServerCallback.GetInstance().VisitNewTable(this);
     _server.Ready = !_server.Ready;
     _server.BeginDeclareReadiness(_server.Token, _server.Ready, ReadinessCallback, null);
 }