Add SystemInfo to AboutPage
This commit is contained in:
@@ -61,6 +61,7 @@ namespace MarketData.Service
|
||||
{
|
||||
return null==baseUri?"":baseUri.ToString();
|
||||
}
|
||||
|
||||
public bool Ping(String url)
|
||||
{
|
||||
lock(this)
|
||||
@@ -98,6 +99,30 @@ namespace MarketData.Service
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ServiceResult GetSystemInfo()
|
||||
{
|
||||
lock(this)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(!IsNetworkAvailable())return new ServiceResult(false,"No network.");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("/api/Ping/GetSystemInfo");
|
||||
String json = httpClient.GetStringAsync(sb.ToString()).Result;
|
||||
json=ToConformimgJson(json);
|
||||
String accessToken = JsonConvert.DeserializeObject<String>(json);
|
||||
return new ServiceResult(accessToken);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
exceptions.Add(exception);
|
||||
Debug.WriteLine(exception.ToString());
|
||||
return new ServiceResult(false,exception.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ServiceResult Login(String user, String password)
|
||||
{
|
||||
lock(this)
|
||||
|
||||
@@ -119,6 +119,18 @@ namespace Navigator.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public String SystemInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
String systemInfo = "";
|
||||
ServiceResult serviceResult = MarketDataServiceClient.GetInstance().GetSystemInfo();
|
||||
if(serviceResult.Success)systemInfo=(String)serviceResult.ContextSpecificResult;
|
||||
return "System Info: "+systemInfo;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String ScreenDimensions
|
||||
{
|
||||
get
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
</Button>
|
||||
<Label Text="{Binding Status,Mode=TwoWay}" />
|
||||
<Label Text="{Binding ScreenDimensions, Mode=OneWay}"/>
|
||||
<Label Text="{Binding SystemInfo, Mode=OneWay}"/>
|
||||
<Label Text="{Binding Date, Mode=OneWay}"/>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
|
||||
Reference in New Issue
Block a user