Skip to content

Instantly share code, notes, and snippets.

@SuperYeti
Created September 23, 2011 20:05

Revisions

  1. SuperYeti created this gist Sep 23, 2011.
    76 changes: 76 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,76 @@
    using System;
    using MonoMobile.Views;
    using MonoTouch.UIKit;
    using MonoTouch.Foundation;
    using OBDIIEngineLibrary;

    namespace ObdSync
    {
    [Preserve(AllMembers = true)]
    [Theme(typeof(NavbarTheme))]
    public class MainMenuView : View
    {
    [Section("Main Menu", "",Order = 1)]
    [Root(ViewType = typeof(DeviceConfigView))]
    public DeviceConfigViewModel DeviceConfiguration { get; set; }

    [Button]
    public void GetSupportedPids()
    {
    if(!Application.DeviceVerified)
    {
    Alert.Show("Device Not Verified", "You must verify your device before querying it.");
    return;
    }

    SupportedPidsView view = new SupportedPidsView();

    Application.NavigationController.PushViewController(new DialogViewController("Supported PID's", view, true), true);

    }

    [Button]
    public void GetTroubleCodes()
    {
    if(!Application.DeviceVerified)
    {
    Alert.Show("Device Not Verified", "You must verify your device before querying it.");
    return;
    }



    DTCsView view = new DTCsView();

    Application.NavigationController.PushViewController(new DialogViewController("Trouble Codes", view, true), true);

    }

    [Button]
    public void GetVoltage()
    {
    if(!Application.DeviceVerified)
    {
    Alert.Show("Device Not Verified", "You must verify your device before querying it.");
    return;
    }

    Alert.Show("Battery Voltage", "Voltage: " + Application.ElmVoltage.ReadInputVoltage());

    }

    [Button]
    public void DeleteDatabase()
    {
    DAL.DeleteDatabase();

    }

    public MainMenuView()
    {

    }

    }

    }