Add SystemInfo to AboutPage
This commit is contained in:
@@ -61,6 +61,7 @@ namespace MarketData.Service
|
|||||||
{
|
{
|
||||||
return null==baseUri?"":baseUri.ToString();
|
return null==baseUri?"":baseUri.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Ping(String url)
|
public bool Ping(String url)
|
||||||
{
|
{
|
||||||
lock(this)
|
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)
|
private ServiceResult Login(String user, String password)
|
||||||
{
|
{
|
||||||
lock(this)
|
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
|
public String ScreenDimensions
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
</Button>
|
</Button>
|
||||||
<Label Text="{Binding Status,Mode=TwoWay}" />
|
<Label Text="{Binding Status,Mode=TwoWay}" />
|
||||||
<Label Text="{Binding ScreenDimensions, Mode=OneWay}"/>
|
<Label Text="{Binding ScreenDimensions, Mode=OneWay}"/>
|
||||||
|
<Label Text="{Binding SystemInfo, Mode=OneWay}"/>
|
||||||
<Label Text="{Binding Date, Mode=OneWay}"/>
|
<Label Text="{Binding Date, Mode=OneWay}"/>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user