| | |
| | | case FunctionCategory.Curtain: |
| | | #region 窗帘更新 |
| | | var uCurtain = updataFunction as Curtain; |
| | | if (cTag == updataFunction.functionType + "_off_" + updataFunction.sid) |
| | | switch (uCurtain.trait_on_off.curValue.ToString()) |
| | | { |
| | | case "off": |
| | | if (cTag == updataFunction.sid + "_off") |
| | | { |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = uCurtain.trait_on_off.curValue.ToString() == "off"; |
| | | (fcView.GetChildren(j) as Button).IsSelected = true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"{this.GetType()} error 3 : {ex.Message}"); |
| | | } |
| | | catch { } |
| | | } |
| | | else |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = false; |
| | | } |
| | | break; |
| | | case "on": |
| | | if (cTag == updataFunction.sid + "_on") |
| | | { |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = uCurtain.trait_on_off.curValue.ToString() == "on"; |
| | | (fcView.GetChildren(j) as Button).IsSelected = true; |
| | | } |
| | | catch (Exception ex) |
| | | catch { } |
| | | } |
| | | else |
| | | { |
| | | MainPage.Log($"{this.GetType()} error 4 : {ex.Message}"); |
| | | (fcView.GetChildren(j) as Button).IsSelected = false; |
| | | } |
| | | break; |
| | | case "stop": |
| | | if (cTag == updataFunction.sid + "_stop") |
| | | { |
| | | try |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = true; |
| | | } |
| | | catch { } |
| | | } |
| | | else |
| | | { |
| | | (fcView.GetChildren(j) as Button).IsSelected = false; |
| | | } |
| | | break; |
| | | } |
| | | #endregion |
| | | break; |