Exemplo n.º 1
0
        public StateWatcher(CoreDispatcher dispatcher, StateView stateView, Controller controller)
        {
            m_Dispatcher = dispatcher;
            m_View = stateView;
            m_Controller = controller;
            m_InvokeTimeout = new TimeSpan(500000); // 50 ms
            m_UpdateTimer = Stopwatch.StartNew();

            CreateUpdaters();

            // Register for state updates
            m_Controller.StateUpdate += OnStateUpdate;
        }
Exemplo n.º 2
0
        public MainPage()
        {
            this.InitializeComponent();

            m_Connection = new Connection("localhost", 7474);
            m_ServerConnectionState = ServerConnectionState.Disconnected;
            m_Controller = new Controller(m_Connection);
            m_StateView = new StateView();
            m_StateWatcher = new StateWatcher(Dispatcher, m_StateView, m_Controller);

            m_ServerConnectionStateTimer = ThreadPoolTimer.CreatePeriodicTimer(ServerConnectionStateUpdate, TimeSpan.FromSeconds(1.0));

            DataContext = m_StateView;
        }