| 1 |
using System; |
| 2 |
using System.Collections.Generic; |
| 3 |
using System.IO; |
| 4 |
using System.Linq; |
| 5 |
using System.Runtime.InteropServices.WindowsRuntime; |
| 6 |
using Windows.Foundation; |
| 7 |
using Windows.Foundation.Collections; |
| 8 |
using Windows.UI.Xaml; |
| 9 |
using Windows.UI.Xaml.Controls; |
| 10 |
using Windows.UI.Xaml.Controls.Primitives; |
| 11 |
using Windows.UI.Xaml.Data; |
| 12 |
using Windows.UI.Xaml.Input; |
| 13 |
using Windows.UI.Xaml.Media; |
| 14 |
using Windows.UI.Xaml.Navigation; |
| 15 |
using PjsuaCLI.BackEnd; |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
namespace PjsuaCLI.UI |
| 20 |
{ |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
public partial class MainPage : Page, IPjsuaCallback |
| 25 |
{ |
| 26 |
public MainPage() |
| 27 |
{ |
| 28 |
this.InitializeComponent(); |
| 29 |
} |
| 30 |
|
| 31 |
public virtual void OnPjsuaStarted(string outStr) |
| 32 |
{ |
| 33 |
setStatus(outStr); |
| 34 |
} |
| 35 |
|
| 36 |
public virtual void OnPjsuaStopped(int restart) |
| 37 |
{ |
| 38 |
setStatus("Telnet stopped, restart(" + (restart == 0 ? "No" : "Yes") + ")"); |
| 39 |
} |
| 40 |
|
| 41 |
public void setStatus(string status) |
| 42 |
{ |
| 43 |
txtStatus.Text = status; |
| 44 |
} |
| 45 |
|
| 46 |
protected override void OnNavigatedTo(NavigationEventArgs e) |
| 47 |
{ |
| 48 |
base.OnNavigatedTo(e); |
| 49 |
|
| 50 |
Globals.Instance.PjsuaCallback.SetCallback(this); |
| 51 |
Globals.Instance.pjsuaStart(); |
| 52 |
} |
| 53 |
|
| 54 |
protected override void OnNavigatedFrom(NavigationEventArgs e) |
| 55 |
{ |
| 56 |
base.OnNavigatedFrom(e); |
| 57 |
Globals.Instance.pjsuaDestroy(); |
| 58 |
} |
| 59 |
} |
| 60 |
} |