Example #1
0
        public override void LoadView()
        {
            name = new LimitedEntryElement ("Name", "Enter the name of the pilot.", Pilot.Name);
            cfi = new BooleanElement ("Certified Flight Instructor", Pilot.IsCertifiedFlightInstructor);
            aifr = new BooleanElement ("Instrument Rated (Airplane)", Pilot.InstrumentRatings.HasFlag (InstrumentRating.Airplane));
            hifr = new BooleanElement ("Instrument Rated (Helicopter)", Pilot.InstrumentRatings.HasFlag (InstrumentRating.Helicopter));
            lifr = new BooleanElement ("Instrument Rated (Powered-Lift)", Pilot.InstrumentRatings.HasFlag (InstrumentRating.PoweredLift));
            certification = CreatePilotCertificationElement (Pilot.Certification);
            endorsements = CreateEndorsementsElement (Pilot.Endorsements);
            birthday = new DateEntryElement ("Date of Birth", Pilot.BirthDate);
            medical = new DateEntryElement ("Last Medical Exam", Pilot.LastMedicalExam);
            review = new DateEntryElement ("Last Flight Review", Pilot.LastFlightReview);

            base.LoadView ();

            Root.Add (new Section ("Pilot Information") { name, birthday, certification, endorsements, aifr, hifr, lifr, cfi });
            Root.Add (new Section ("Pilot Status") { medical, review });
        }
Example #2
0
        Section CreateFlightSection()
        {
            AirportEntryElement airport;

            date     = new DateEntryElement("Date", Flight.Date);
            aircraft = new AircraftEntryElement(Flight.Aircraft)
            {
                AutoComplete = true
            };
            departed = new AirportEntryElement("Departed", Flight.AirportDeparted);
            arrived  = new AirportEntryElement("Arrived", Flight.AirportArrived);

            visited = new List <AirportEntryElement> (3);

            var section = new Section("Flight");

            section.Add(date);
            section.Add(aircraft);
            section.Add(departed);

            string str = Flight.AirportVisited;

            if (!string.IsNullOrEmpty(str))
            {
                foreach (var via in str.Split(new char[] { ',' }))
                {
                    airport = new AirportEntryElement("Visited", via.Trim());
                    airport.EditingCompleted += OnVisitedAirportEdited;
                    section.Add(airport);
                    visited.Add(airport);
                }
            }

            airport = new AirportEntryElement("Visited", string.Empty);
            airport.EditingCompleted += OnVisitedAirportEdited;
            section.Add(airport);
            visited.Add(airport);

            section.Add(arrived);

            return(section);
        }
Example #3
0
        public override void LoadView()
        {
            name          = new LimitedEntryElement("Name", "Enter the name of the pilot.", Pilot.Name);
            cfi           = new BooleanElement("Certified Flight Instructor", Pilot.IsCertifiedFlightInstructor);
            aifr          = new BooleanElement("Instrument Rated (Airplane)", Pilot.InstrumentRatings.HasFlag(InstrumentRating.Airplane));
            hifr          = new BooleanElement("Instrument Rated (Helicopter)", Pilot.InstrumentRatings.HasFlag(InstrumentRating.Helicopter));
            lifr          = new BooleanElement("Instrument Rated (Powered-Lift)", Pilot.InstrumentRatings.HasFlag(InstrumentRating.PoweredLift));
            certification = CreatePilotCertificationElement(Pilot.Certification);
            endorsements  = CreateEndorsementsElement(Pilot.Endorsements);
            birthday      = new DateEntryElement("Date of Birth", Pilot.BirthDate);
            medical       = new DateEntryElement("Last Medical Exam", Pilot.LastMedicalExam);
            review        = new DateEntryElement("Last Flight Review", Pilot.LastFlightReview);

            base.LoadView();

            Root.Add(new Section("Pilot Information")
            {
                name, birthday, certification, endorsements, aifr, hifr, lifr, cfi
            });
            Root.Add(new Section("Pilot Status")
            {
                medical, review
            });
        }
        Section CreateFlightSection()
        {
            AirportEntryElement airport;

            date = new DateEntryElement ("Date", Flight.Date);
            aircraft = new AircraftEntryElement (Flight.Aircraft) { AutoComplete = true };
            departed = new AirportEntryElement ("Departed", Flight.AirportDeparted);
            arrived = new AirportEntryElement ("Arrived", Flight.AirportArrived);

            visited = new List<AirportEntryElement> (3);

            var section = new Section ("Flight");
            section.Add (date);
            section.Add (aircraft);
            section.Add (departed);

            string str = Flight.AirportVisited;
            if (!string.IsNullOrEmpty (str)) {
                foreach (var via in str.Split (new char[] { ',' })) {
                    airport = new AirportEntryElement ("Visited", via.Trim ());
                    airport.EditingCompleted += OnVisitedAirportEdited;
                    section.Add (airport);
                    visited.Add (airport);
                }
            }

            airport = new AirportEntryElement ("Visited", string.Empty);
            airport.EditingCompleted += OnVisitedAirportEdited;
            section.Add (airport);
            visited.Add (airport);

            section.Add (arrived);

            return section;
        }