コード例 #1
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());
        }
コード例 #2
0
        public MeasurementPage()
        {
            InitializeComponent();
            NavigationPage.SetHasNavigationBar(this, false);

            measurement = new WineMeasurement();
            file        = null;
        }
コード例 #3
0
        private async void LoadFromCloud()
        {
            var blobList = await CloudStorage.GetBlobList("measurements");

            Console.WriteLine($"Measurements count: {blobList.Count}");
            foreach (var blob in blobList)
            {
                var meas = WineMeasurement.Parse(await blob.DownloadTextAsync());
                Console.WriteLine($"Measurement: {meas.Time}");
                Items.Add(meas);
            }
        }