Ejemplo n.º 1
0
            public void LoadCellValues(CircuitViewModel circuit)
            {
                ExceptionUtility.Try(() =>
                {
                    this._circuit = circuit;

                    if (circuit.Running)
                    {
                        this.SetLine1Font(BoldCellTextFont);
                        this._checkbox.Hidden = true;
                    }
                    else
                    {
                        this.SetLine1Font(NormalCellTextFont);
                        this._checkbox.Hidden = false;
                    }

                    if (circuit.HasFault)
                    {
                        this.SetLine2TextColor(Colors.ErrorTextColor);
                    }
                    else
                    {
                        this.SetLine2TextColor(Colors.StandardTextColor);
                    }

                    if (circuit.HighlightGreen)
                    {
                        this.SetTextColor(Colors.AquamonixGreen);
                    }
                    else
                    {
                        this.SetTextColor(Colors.AquamonixBrown);
                    }

                    this.LoadCellValues(this._circuit.Id, this._circuit.Name, this._circuit.Description);

                    _checkbox.SetChecked(circuit.Selected);

                    if (circuit.Running)
                    {
                        this.SetStatus(StringLiterals.Running.ToUpper()); //"RUNNING");
                    }
                    else if (circuit.Starting)
                    {
                        this.SetStatus(StringLiterals.Starting.ToUpper()); //"STARTING");
                    }
                    else
                    {
                        this.SetStatus(null);
                    }

                    _powerIconImageView.Hidden = (!circuit.DisplayPowerIcon);
                });
            }
Ejemplo n.º 2
0
            public void LoadCellValues(StationViewModel station)
            {
                ExceptionUtility.Try(() =>
                {
                    this._station = station;

                    if (station.Running)
                    {
                        this.SetLine1Font(BoldCellTextFont);
                        this._checkbox.Hidden = true;
                    }
                    else
                    {
                        this.SetLine1Font(NormalCellTextFont);
                        this._checkbox.Hidden = false;
                    }

                    this.LoadCellValues(station.Id, station.Name, station.Description);
                    _checkbox.SetChecked(station.Selected);

                    if (station.ZoneColor == null)
                    {
                        _colorView.BackgroundColor = UIColor.White;
                    }
                    else
                    {
                        _colorView.BackgroundColor = Colors.FromHex(station.ZoneColor.Value);
                    }

                    if (station.Running)
                    {
                        this.SetStatus(StringLiterals.Running.ToUpper());
                    }
                    else if (station.Starting) //TODO: replace with IsUpdatingStatus
                    {
                        this.SetStatus(StringLiterals.Starting.ToUpper());
                    }
                    else
                    {
                        this.SetStatus(null);
                    }
                });
            }