| | |
| | | { |
| | | public class AcControlPage_AddIrButton : FrameLayout |
| | | { |
| | | public AcControlPage_AddIrButton() |
| | | Action action; |
| | | |
| | | public AcControlPage_AddIrButton(Action act) |
| | | { |
| | | action = act; |
| | | } |
| | | public void Show(Function control) |
| | | { |
| | |
| | | |
| | | //添加数据对象 |
| | | AttributesStatus buttonObj = new AttributesStatus(); |
| | | |
| | | //防止key不唯一 |
| | | var attrCount = control.attributes.Count; |
| | | var keyString = "key" + attrCount; |
| | | while (true) |
| | | { |
| | | if (control.attributes.Find((obj) => obj.key == keyString) == null) |
| | | { |
| | | break; |
| | | } |
| | | keyString = "key" + (++attrCount); |
| | | } |
| | | buttonObj.key = "key" + control.attributes.Count.ToString(); |
| | | buttonObj.value = texts; |
| | | |
| | |
| | | { |
| | | control.attributes.Add(new FunctionAttributes() { key = buttonObj.key, value = new System.Collections.Generic.List<string>() { buttonObj.value } }); |
| | | this.RemoveFromParent(); |
| | | action?.Invoke(); |
| | | //new TipPopView().FlashingBox(Language.StringByID(StringId.tianjiachenggong)); |
| | | } |
| | | else |
| | | { |