Skip to content

Instantly share code, notes, and snippets.

@SuperYeti
Created September 23, 2011 20:05
Show Gist options
  • Save SuperYeti/1238337 to your computer and use it in GitHub Desktop.
Save SuperYeti/1238337 to your computer and use it in GitHub Desktop.
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()
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment