private async void ReadyButton_Clicked(object sender, EventArgs e)
        {
            ReadyButton.BackgroundColor = Color.Green;
            try
            {
                Console.WriteLine("Uploading mediafile");
                string file_name = $"{measurement.Time.ToString("yyyy.MM.dd_hh.mm.ss")}";
                await CloudStorage.UploadBlobStream("pictures",
                                                    file_name + ".jpg",
                                                    file.GetStream());

                measurement.Photo = CloudStorage.GetBlobUri("pictures", file_name + ".jpg");
                measurement.Text  = "Processing...";
                //Set spectrum
                //??

                Console.WriteLine("Uploading measurement");
                await CloudStorage.UploadBlobText("measurements", file_name + ".txt",
                                                  measurement.ToString());

                Console.WriteLine("OK!");
            }
            catch (Exception ex)
            {
            }
            await Navigation.PopAsync();
        }
示例#2
0
        private async void AboutButton_Clicked(object sender, EventArgs e)
        {
            DebugWriteLine("Test WineMeasurement");
            var meas = new WineMeasurement()
            {
                Time     = DateTime.Now,
                WineID   = "WineID",
                Text     = "Text1\nText2\nText3",
                Photo    = CloudStorage.GetBlobUri("container1", "test1.txt"),
                Spectrum = new double[24],
            };

            var meas_str = meas.ToString();

            DebugWriteLine(meas_str);

            DebugWriteLine("Uploading");
            await CloudStorage.UploadBlobText("container1", "test1.txt", meas_str.ToString());

            DebugWriteLine("Downloading");
            meas_str = await CloudStorage.DownloadBlobText("container1", "test1.txt");

            DebugWriteLine("Parsed WineMeasurement");
            var meas2 = WineMeasurement.Parse(meas_str);

            DebugWriteLine(meas2.ToString());
        }