Esempio n. 1
0
        public void initializeUserInterface()
        {
            // 0. Chemical Template

            chemicalTemplateDict = new Dictionary<string, ChemicalTemplate> ();
            chemicalTemplateDict = LocalStorage.getLocalStorageManager ().loadChemicalTemplate();

            Section chemicalTemplateS = new Section ("Chemical Template");
            chemicalTemplate = new RadioGroup (0);

            Section stSection = new Section ();
            foreach(var templateName in chemicalTemplateDict){
                var t = new myRadioElement(templateName.Value.templateName);
                t.OnSelected += delegate(object sender, EventArgs e) {

                    InvokeOnMainThread(()=>{
                        loadValueFromTemplate(t.Caption);
                    });
                };
                stSection .Add(t);
            }
            RootElement stRoot = new RootElement ("Chemical Template", chemicalTemplate) { };
            stRoot.Add(stSection);
            chemicalTemplateS.Add (stRoot);

            // 1. Chemical Date
            Section chemicalDateS = new Section ("Chemical Date");
            chemicalDate = new DateElement ("", DateTime.Now);
            chemicalDateS.Add (this.chemicalDate);

            // 2. Implemented Used
            Section implementedUsedS = new Section ("Implemented Used");
            tools = new EntryElement (" ","Tools","");
            tools.ShouldReturn += delegate {
                tools.ResignFirstResponder(true);
                return true;
            };
            tools.ReturnKeyType = UIReturnKeyType.Done;
            implementedUsedS.Add (tools);

            // 3. Seed Type
            Section chemicalTypeS = new Section ("Chemical Types");

            chemicalTypes = new EntryElement (" ", "Chemical Types", "");
            chemicalTypes.ShouldReturn += delegate {
                chemicalTypes.ResignFirstResponder(true);
                return true;
            };
            chemicalTypes.ReturnKeyType = UIReturnKeyType.Done;
            chemicalTypeS.Add (chemicalTypes);

            // 4. chemical Rate
            Section chemicalRateS = new Section ("Chemical Rate (L/ac)");
            chemicalRate = new EntryElement (" ", "Chemical Rates", "");
            chemicalRate.ShouldReturn += delegate {
                chemicalRate.ResignFirstResponder(true);
                return true;
            };
            chemicalRate.ReturnKeyType = UIReturnKeyType.Done;
            chemicalRateS.Add (chemicalRate);

            // 5. Note
            Section noteS = new Section ("Notes");
            note = new SimpleMultilineEntryElement ("", " ") { Editable = true };
            noteS.Add (note);

            Root.Add (chemicalTemplateS);
            Root.Add (chemicalDateS);
            Root.Add (implementedUsedS);
            Root.Add (chemicalTypeS);
            Root.Add (chemicalRateS);
            Root.Add (noteS);
        }
Esempio n. 2
0
        public void initializeUserInterface()
        {
            // 0. Seed Templates
            seedTemplateDict = new Dictionary<string, SeedTemplate> ();
            seedTemplateDict = LocalStorage.getLocalStorageManager ().loadSeedTemplate ();

            Section seedTemplateS = new Section ("Seed Template");
            seedTemplate = new RadioGroup (0);

            Section stSection = new Section ();
            foreach(var templateName in seedTemplateDict){
                var t = new myRadioElement(templateName.Value.templateName);
                t.OnSelected += delegate(object sender, EventArgs e) {

                    InvokeOnMainThread(()=>{
                        loadValueFromTemplate(t.Caption);
                    });
            };
                stSection .Add(t);
            }
            RootElement stRoot = new RootElement ("Seed Template", seedTemplate) { };
            stRoot.Add(stSection);

            seedTemplateS.Add (stRoot);

            // 1. Seed Date
            Section seedDateS = new Section ("Seed Date");
            this.seedDate = new DateElement ("", DateTime.Now);
            seedDateS.Add (this.seedDate);

            // 2. Seed Type
            Section seedTypeS = new Section ("Seed Types");

            seedTypes = new EntryElement (" ", "Seed Types", "");
            seedTypes.ShouldReturn += delegate {
                seedTypes.ResignFirstResponder(true);
                return true;
            };
            seedTypes.ReturnKeyType = UIReturnKeyType.Done;
            seedTypeS.Add (seedTypes);

            // 3. Seeding Depth
            Section seedDepthS = new Section ("Seeding Depth (in)");
            //			seedDepth = new FloatElementEx (0, lockable: false) {
            //				ShowCaption = true,
            //				UseCaptionForValueDisplay = true,
            //				MaxValue = 2,
            //			};
            seedDepth = new EntryElement(" ","Seed Depth", "");
            seedDepth.ShouldReturn += delegate {
                seedDepth.ResignFirstResponder(true);
                return true;
            };
            seedDepth.ReturnKeyType = UIReturnKeyType.Done;
            seedDepthS.Add(seedDepth);

            // 4. Implemented Used
            Section implementedUsedS = new Section ("Implemented Used");
            tools = new EntryElement (" ","Tools","");
            tools.ShouldReturn += delegate {
                tools.ResignFirstResponder(true);
                return true;
            };
            tools.ReturnKeyType = UIReturnKeyType.Done;
            implementedUsedS.Add (tools);

            // 5. Variety Name
            Section varietyNameS = new Section ("Variety Name");
            varietyName = new EntryElement (" ","Enter Variety Name","");
            varietyName.ReturnKeyType = UIReturnKeyType.Done;
            varietyName.ShouldReturn += delegate {

                varietyName.ResignFirstResponder(true);
                return true;
            };
            varietyNameS.Add (varietyName);

            // 6. Seed Rate
            Section seedRateS = new Section ("Seed Rate (lb/ac)");
            seedRate = new FloatElementEx (0, lockable: false) {
                ShowCaption = true,
                UseCaptionForValueDisplay = true,
                MaxValue = 300,
            };
            seedRateS.Add(seedRate);

            // 7. Seed Treatment
            Section seedTreatmentS = new Section ("Seed Treatment");
            seedTreatment = new  EntryElement (" ","Enter Seed Treatment","");
            seedTreatment.ReturnKeyType = UIReturnKeyType.Done;

            seedTreatmentS.Add (seedTreatment);

            // 8. NH3
            Section NH3S = new Section ("NH3 (lb/ac)");
            NH3 = new FloatElementEx (0, lockable: false) {
                ShowCaption = true,
                UseCaptionForValueDisplay = true,
                MaxValue = 120,
            };
            NH3S.Add (NH3);

            // 9. 11-52-20
            Section _11S = new Section ("11-52-20 (lb/ac)");
            _11 = new FloatElementEx (0, lockable: false) {
                ShowCaption = true,
                UseCaptionForValueDisplay = true,
                MaxValue = 100,
            };
            _11S.Add(_11);

            // 10. Note
            Section noteS = new Section ("Notes");

            note = new SimpleMultilineEntryElement ("", " ") { Editable = true };
            noteS.Add (note);

            Root.Add (seedTemplateS);
            Root.Add (seedDateS);
            Root.Add (seedTypeS);
            Root.Add (implementedUsedS);
            Root.Add (seedDepthS);
            Root.Add (varietyNameS);
            Root.Add (seedRateS);
            Root.Add (seedTreatmentS);
            Root.Add (NH3S);
            Root.Add (_11S);
            Root.Add (noteS);
        }