public void UpdateQosState(Model.QosRuleList qosRules) { int index = qosRules.GetRuleIndex(this.mac); if (index >= 0) { isQosLimit = qosRules[index].enable; qos_down = qosRules[index].down; qos_up = qosRules[index].up; } else { isQosLimit = false; } RaisePropertyChanged("isQosLimit"); RaisePropertyChanged("devQosImage"); }
public static async Task <bool> SetQosRuleList(Model.QosRuleList qosRules) { try { string json = "{ \"qos_enable\": \"1\", \"qos_type\": \"2\", \"qos_bw_rulelist\": \"{0}\", \"action_mode\": \"apply\" }"; json = json.Replace("{0}", qosRules.ToString()); var res = await ApplyApp(json); if (res != null) { return(await FireWall.RestartFireWall()); } else { return(false); } } catch (Exception) { return(false); } }