public void ProcessResponseStream(Stream stream) { if (stream == null) { return; } using (var reader = new StreamReader(stream)) { var json = reader.ReadToEnd(); CurrentStatus = JsonConvert.DeserializeObject <ClientStatus> (json); UpdateUI(CurrentStatus); } }
void UpdateUI(ClientStatus status) { if (status == null) { return; } tlsVersion.Text = status.TlsVersion; splitting.Text = status.AbleToDetectNMinusOneSplitting.ToString(); beastVuln.Text = status.BeastVuln.ToString(); cipherSuite.Text = status.UnknownCipherSuiteSupported.ToString(); tlsCompression.Text = status.TlsCompressionSupported.ToString(); ticketSupported.Text = status.SessionTicketSupported.ToString(); ephemeralKeysSupported.Text = status.EphemeralKeysSupported.ToString(); }
void UpdateUI(ClientStatus status, string rawJson) { if (status == null) { return; } tlsVersion.Text = status.TlsVersion; splitting.Text = status.AbleToDetectNMinusOneSplitting.ToString(); beastVuln.Text = status.BeastVuln.ToString(); cipherSuite.Text = status.UnknownCipherSuiteSupported.ToString(); tlsCompression.Text = status.TlsCompressionSupported.ToString(); ticketSupported.Text = status.SessionTicketSupported.ToString(); ephemeralKeysSupported.Text = status.EphemeralKeysSupported.ToString(); rating.Text = status.Rating; diagnosticResponse.Text = JObject.Parse(rawJson).ToString(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Main); var netRequestButton = FindViewById <Button> (Resource.Id.NetRequestButton); netRequestButton.Click += async delegate { netRequestButton.Enabled = !netRequestButton.Enabled; string json = await RunRequest(); CurrentStatus = JsonConvert.DeserializeObject <ClientStatus> (json); UpdateUI(CurrentStatus, json); netRequestButton.Enabled = !netRequestButton.Enabled; }; var nativeRequestButton = FindViewById <Button> (Resource.Id.NativeRequestButton); nativeRequestButton.Click += async delegate { nativeRequestButton.Enabled = !nativeRequestButton.Enabled; string json = await RunNativeRequest(); CurrentStatus = JsonConvert.DeserializeObject <ClientStatus>(json); UpdateUI(CurrentStatus, json); nativeRequestButton.Enabled = !nativeRequestButton.Enabled; }; layout = FindViewById(Resource.Id.sample_main_layout); tlsVersion = FindViewById <TextView> (Resource.Id.TlsVersion); splitting = FindViewById <TextView> (Resource.Id.Splitting); beastVuln = FindViewById <TextView> (Resource.Id.BeastVuln); cipherSuite = FindViewById <TextView> (Resource.Id.CipherSuite); tlsCompression = FindViewById <TextView> (Resource.Id.TlsCompression); ticketSupported = FindViewById <TextView> (Resource.Id.TicketSupported); ephemeralKeysSupported = FindViewById <TextView> (Resource.Id.EphemeralKeysSupported); rating = FindViewById <TextView> (Resource.Id.Rating); diagnosticResponse = FindViewById <TextView> (Resource.Id.FullResponseText); }
protected override void OnCreate (Bundle savedInstanceState) { base.OnCreate (savedInstanceState); SetContentView (Resource.Layout.Main); var netRequestButton = FindViewById<Button> (Resource.Id.NetRequestButton); netRequestButton.Click += async delegate { netRequestButton.Enabled = !netRequestButton.Enabled; string json = await RunRequest (); CurrentStatus = JsonConvert.DeserializeObject<ClientStatus> (json); UpdateUI (CurrentStatus); netRequestButton.Enabled = !netRequestButton.Enabled; }; var nativeRequestButton = FindViewById<Button> (Resource.Id.NativeRequestButton); nativeRequestButton.Click += async delegate { nativeRequestButton.Enabled = !nativeRequestButton.Enabled; string json = await RunNativeRequest (); CurrentStatus = JsonConvert.DeserializeObject<ClientStatus>(json); UpdateUI (CurrentStatus); nativeRequestButton.Enabled = !nativeRequestButton.Enabled; }; layout = FindViewById (Resource.Id.sample_main_layout); tlsVersion = FindViewById<TextView> (Resource.Id.TlsVersion); splitting = FindViewById<TextView> (Resource.Id.Splitting); beastVuln = FindViewById<TextView> (Resource.Id.BeastVuln); cipherSuite = FindViewById<TextView> (Resource.Id.CipherSuite); tlsCompression = FindViewById<TextView> (Resource.Id.TlsCompression); ticketSupported = FindViewById<TextView> (Resource.Id.TicketSupported); ephemeralKeysSupported = FindViewById<TextView> (Resource.Id.EphemeralKeysSupported); }
void UpdateUI (ClientStatus status) { if (status == null) return; tlsVersion.Text = status.TlsVersion; splitting.Text = status.AbleToDetectNMinusOneSplitting.ToString (); beastVuln.Text = status.BeastVuln.ToString (); cipherSuite.Text = status.UnknownCipherSuiteSupported.ToString (); tlsCompression.Text = status.TlsCompressionSupported.ToString (); ticketSupported.Text = status.SessionTicketSupported.ToString (); ephemeralKeysSupported.Text = status.EphemeralKeysSupported.ToString (); }
public void ProcessResponseStream (Stream stream) { if (stream == null) return; using (var reader = new StreamReader (stream)) { var json = reader.ReadToEnd (); CurrentStatus = JsonConvert.DeserializeObject<ClientStatus> (json); UpdateUI (CurrentStatus); } }