private void OnStatusChange(ConnectionInfo connectionInfo) { Server = connectionInfo.Server; switch (connectionInfo.ConnectionStatus) { case ConnectionStatus.Uninitialized: case ConnectionStatus.Connecting: Status = "Connecting..."; Disconnected = true; break; case ConnectionStatus.Reconnected: case ConnectionStatus.Connected: Status = "Connected"; Disconnected = false; break; case ConnectionStatus.ConnectionSlow: Status = "Slow connection detected"; Disconnected = false; break; case ConnectionStatus.Reconnecting: Status = "Reconnecting..."; Disconnected = true; break; case ConnectionStatus.Closed: Status = "Disconnected"; Disconnected = true; break; default: throw new ArgumentOutOfRangeException(); } }
private void OnStatusChange(ConnectionInfo connectionInfo) { if (this.IsViewLoaded) { this.ConnectionDetail.Text = connectionInfo.Server; this.ConnectionDetail.SizeToFit (); // Multi-line, with initially small height. this.ConnectionStatus.Text = connectionInfo.ConnectionStatus.ToString (); } else { _lastConnectionInfo = connectionInfo; } }
private void OnStatusChange(ConnectionInfo connectionInfo) { if (View != null) { //View.FindViewById<TextView>(Resource.Id.server).Text = connectionInfo.Server; //View.FindViewById<TextView>(Resource.Id.status).Text = connectionInfo.ConnectionStatus.ToString(); } else { _lastConnectionInfo = connectionInfo; } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment var view = inflater.Inflate(Resource.Layout.Status, container, false); view.FindViewById<TextView>(Resource.Id.traderId).Text = App.Username; if (_lastConnectionInfo != null) { OnStatusChange(_lastConnectionInfo); _lastConnectionInfo = null; } return view; }
public override void ViewDidLoad () { base.ViewDidLoad (); // Perform any additional setup after loading the view, typically from a nib. // The connection detail text area wraps and is resizable. // Note that this requires us to turn off Auto-layout for this view. this.ConnectionDetail.LineBreakMode = UILineBreakMode.CharacterWrap; this.TraderId.Text = UserModel.Instance.TraderId; if (_lastConnectionInfo != null) { OnStatusChange (_lastConnectionInfo); _lastConnectionInfo = null; } }
public override void ViewDidLoad () { base.ViewDidLoad (); UIEdgeInsets adjustForTabbarInsets = new UIEdgeInsets(UIApplication.SharedApplication.StatusBarFrame.Height, 0, TabBarController.TabBar.Frame.Height, 0); _scrollView.ContentInset = adjustForTabbarInsets; _scrollView.ScrollIndicatorInsets = adjustForTabbarInsets; this.TraderId.Text = UserModel.Instance.TraderId; if (_lastConnectionInfo != null) { OnStatusChange (_lastConnectionInfo); _lastConnectionInfo = null; } _notificationsSwitch.Bind(_notificationsEnabled) .Add(_disposables); }