// set with button recreation
        public void SetEndPointViewModel(EndpointSettingViewModel endpointSettingViewModel)
        {
            this.endpointSettingviewModel = endpointSettingViewModel;

            endpointSettingViewModel.connected.Subscribe(state =>
            {
                if (state == ConnectionCheckStatus.Connected)
                {
                    image.color = successColor;
                }
                else if (state == ConnectionCheckStatus.Checking)
                {
                    image.color = checkingColor;
                }
                else
                {
                    image.color = failColor;
                }
            }).AddTo(this);
        }
        public static EndpointSettingDataModel Translate(EndpointSettingViewModel viewModel)
        {
            var dataModel = new EndpointSettingDataModel(viewModel.EndPoint, viewModel.EndPointName, viewModel.OffsetFrame, viewModel.ConnectionEnabled);

            return(dataModel);
        }
示例#3
0
        // set with button recreation
        public void SetEndPointViewModel(EndpointSettingViewModel endpointSettingViewModel)
        {
            this.endpointSettingviewModel = endpointSettingViewModel;

            endpointSettingViewModel.connectionEnabled.Subscribe(ChangeBackground).AddTo(this);
        }