public CallPage() { InitializeComponent(); mVoice = App.mVoice; Loaded += new RoutedEventHandler(CallPage_Loaded); }
public SearchPage() { InitializeComponent(); mVoice = App.mVoice; mFiltered = new Conversations(); mFiltered.Dispatcher = Dispatcher; mSearchList.ItemsSource = mFiltered; mTimer.Tick += new EventHandler(mTimer_Tick); mTimer.Interval = new TimeSpan(0, 0, 0, 0, 500); }
/// <summary> /// Constructor for the Application object. /// </summary> public App() { Microsoft.Advertising.Mobile.UI.AdControl.TestMode = false; // Global handler for uncaught exceptions. UnhandledException += Application_UnhandledException; // Show graphics profiling information while debugging. if (System.Diagnostics.Debugger.IsAttached) { // Display the current frame rate counters. Application.Current.Host.Settings.EnableFrameRateCounter = true; // Show the areas of the app that are being redrawn in each frame. //Application.Current.Host.Settings.EnableRedrawRegions = true; // Enable non-production analysis visualization mode, // which shows areas of a page that are being GPU accelerated with a colored overlay. //Application.Current.Host.Settings.EnableCacheVisualization = true; } // Standard Silverlight initialization InitializeComponent(); // Phone-specific initialization InitializePhoneApplication(); CreatingANotificationChannel(); var settings = Settings.Instance; mVoice = new GoogleVoiceClient(RootVisual.Dispatcher); mVoice.DevicePhoneNumber = settings.DevicePhoneNumber; mVoice.PIN = settings.PIN; mVoice.AuthToken = settings.AuthToken; mVoice.RNRSE = settings.RNRSE; var conn = SqliteDatabase.Connection; conn.CreateTable<Conversation>(); conn.CreateTable<Message>(); conn.CreateTable<PhotoEntry>(); //SqliteDatabase.Connection.Execute("DROP TABLE Conversation"); //SqliteDatabase.Connection.Execute("DROP TABLE Message"); //SqliteDatabase.Connection.Execute("DELETE FROM Conversation"); //SqliteDatabase.Connection.Execute("DELETE FROM Message"); }
public MainPage2() { InitializeComponent(); if (Settings.IsTrial) mAdControl.Visibility = System.Windows.Visibility.Visible; mVoice = App.mVoice; DataContext = mVoice; Loaded += new RoutedEventHandler(PageLoaded); Unloaded += new RoutedEventHandler(PageUnloaded); mVoice.DownloadContactsStarted += new Action(Voice_DownloadContactsStarted); mVoice.DownloadContactsCompleted += new Action(Voice_DownloadContactsCompleted); mVoice.RefreshInboxStarted += new Action(Voice_RefreshInboxStarted); mVoice.RefreshInboxCompleted += new Action(Voice_RefreshInboxCompleted); mPivot.LoadedPivotItem += new EventHandler<PivotItemEventArgs>(Pivot_LoadedPivotItem); mPivot.LoadingPivotItem += new EventHandler<PivotItemEventArgs>(Pivot_LoadingPivotItem); var settings = Settings.Instance; if (!settings.HasValidLogin) { ShowLogin(true); } else { mVersion.Text = "1.2"; if (settings.LastWhatsNew != mVersion.Text) { settings.LastWhatsNew = mVersion.Text; mChangelog.Items.Add("* Push is available to trial version users (ads enabled)"); mChangelog.Items.Add("* Push notifications are now sent for voicemail"); mChangelog.Items.Add("* Call Log"); mChangelog.Items.Add("* Search Conversations and Voicemail"); mChangelog.Items.Add("* Added keyboard autocompletion"); mChangelog.Items.Add("* Outgoing calls now open a call screen"); mChangelog.Items.Add("* Fixed potential application startup crash"); mChangelog.Items.Add("* Contact photo downloads are more reliable"); mChangelog.Items.Add("* Progress indicator now has a textual description"); mChangelog.Items.Add("* Conversations can be deleted"); mChangelog.Items.Add("* Google Voice can be dialed via the application menu"); mChangelog.Items.Add("* Direct/PIN Dial is available via the settings menu"); mChangelog.Items.Add("* Fixed conversation sort order"); ShowWhatsNew(true); settings.Save(); } mProgressBar.SetIsVisible(true); StatusText = "Logging in..."; mVoice.Login(settings.Username, settings.Password, (authToken, rnrse, googleVoicePhoneNumber) => { mProgressBar.SetIsVisible(false); settings.AuthToken = authToken; settings.GoogleVoicePhoneNumber = googleVoicePhoneNumber; settings.RNRSE = rnrse; settings.Save(); mVoice.RefreshInbox(); }, () => { mProgressBar.SetIsVisible(false); }); } }