コード例 #1
0
        private void Initialize()
        {
            this.destinations = new List<IDestination>();

            this.DataContext = this.model;
            this.model.Sensors = new Sensors(this.dispatcher);

            MessageFactory.LoadClasses();

            this.Sensors = this.model.Sensors;

            // the Azure BLOB storage helper is handed to both Camera and audio for stream options
            // if it is not used, no upload will to Azure BLOB will be done
            this.camera = new Camera();
            this.audio = new Audio();

            this.Sensors.OnSensorUpdated += this.Sensors_OnSensorUpdated;
            this.Sensors.Start();

            this.NavigationCacheMode = NavigationCacheMode.Required;

            this.canvas.PointerPressed += async (s, a) => await this.SendEvent(s, a, "pressed");
            this.canvas.PointerReleased += async (s, a) => await this.SendEvent(s, a, "released");

            this.Display.PointerPressed += async (s, a) => await this.SendEvent(s, a, "pressed");
            this.Display.PointerReleased += async (s, a) => await this.SendEvent(s, a, "released");

            this.screen = new Screen(this);
            this.web = new Web(this);
            this.CheckAlwaysRunning();

            this.isRunning = true;
#pragma warning disable 4014
            Task.Run(
                () =>
                    {
                        this.SetService();
                        this.AutoReconnect();
                    });
            Task.Run(() => { this.ProcessMessages(); });
#pragma warning restore 4014
        }
コード例 #2
0
        private void Initialize()
        {
            //blobHelper = new BlobHelper(blobAccountName, blobAccountKey);

            service = new Bluetooth();
            service.OnConnect +=
                async connection =>
                {
                    await SendResult(new SystemResultMessage("CONNECT"), "!!");
                };

            service.OnDisconnected += connection =>
            {
                this.Disconnect();
                // say disconnected... ? reconnecting ? onscreen or allow bt symbol to be all?
            };

            service.Initialize( !appSettings.MissingBackButton );
            ////service = new ServerClient(remoteHost, remoteService);
            ////service.Initialize(); 

            RefreshConnections();

            destinations = new List<IDestination>();

            //ConnectionList = new Connections();
            //connectList.ItemsSource = ConnectionList;

            DataContext = model;
            model.Sensors = new Sensors(dispatcher);
            //SensorStack.ItemsSource = model.Sensors.ItemsList;

            MessageFactory.LoadClasses();

            Sensors = model.Sensors;

            // the Azure BLOB storage helper is handed to both Camera and audio for stream options
            // if it is not used, no upload will to Azure BLOB will be done
            camera = new Camera();
            audio = new Audio();

            CheckSensors();
            Sensors.OnSensorUpdated += Sensors_OnSensorUpdated;
            Sensors.Start();

            NavigationCacheMode = NavigationCacheMode.Required;

            canvas.PointerPressed += async (s, a) => await SendEvent(s, a, "pressed");
            canvas.PointerReleased += async (s, a) => await SendEvent(s, a, "released");

            Display.PointerPressed += async (s, a) => await SendEvent(s, a, "pressed");
            Display.PointerReleased += async (s, a) => await SendEvent(s, a, "released");

            screen = new Screen(this);
            web = new Web(this);
            CheckAlwaysRunning();

            isRunning = true;
#pragma warning disable 4014
            Task.Run(() => { AutoReconnect(); });
            Task.Run(() => { ProcessMessages(); });
#pragma warning restore 4014
        }