Exemplo n.º 1
0
        public async void ProcessScannedValue(string scannedValue)
        {
            Debug.WriteLine("ProcessScannedValue " + scannedValue);
            if (scannedValue.Contains("###"))
            {
                var split = scannedValue.Split(new[] { "###" }, StringSplitOptions.None);
                currentScannedValue     = split[0];
                currentScannedSymbology = split[1];
            }
            else
            {
                currentScannedValue = scannedValue;
            }
            entEdit1.Text = currentScannedValue;

            Debug.WriteLine("scanned: " + currentScannedValue + " symbology: " + currentScannedSymbology);

            var row = new ListOfSettings {
                wmsAddress = currentScannedValue
            };

            lstSet.Add(row);

            Debug.WriteLine(obj.currentCanvasName);

            LstvSettings.ItemTemplate = obj.operatingSystem == "UWP" ? new DataTemplate(typeof(ViewCell1)) : new DataTemplate(typeof(ViewCell2));
            LstvSettings.ItemsSource  = null;
            LstvSettings.ItemsSource  = lstSet;
        }
Exemplo n.º 2
0
        public async void Write(MainPage mp)
        {
            try
            {
                mp.lstSettings = new List <ListOfSettings>();
                var row = new ListOfSettings
                {
                    pEnv       = obj.pEnv,
                    wmsAddress = "http://wms.konesko.ee/KoneskoWMS"
                };
                mp.lstSettings.Add(row);
                var settings = new JsonSerializerSettings()
                {
                    DateFormatHandling = DateFormatHandling.MicrosoftDateFormat
                };
                string input = JsonConvert.SerializeObject(mp.lstSettings, settings);

                var settingsWrite = await DependencyService.Get <IReadWriteSettingsAndroid>().SaveSettingsAsync(input);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("WriteSettings " + ex.Message);
            }
        }