using System; using HDL_ON.Entity; using System.Collections.Generic; namespace HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock { public class CommonMethod { public CommonMethod() { } private static CommonMethod commonMethod = null; public static CommonMethod Current { get { if (commonMethod == null) { commonMethod = new CommonMethod(); } return commonMethod; } } /// /// 跳转到Android那边去 /// public void SkipActivity() { //未实现 } /// /// 萤石视频门锁的图标 /// public string GetVideoDoorLockIcon(Comerom comerom) { if (comerom == Comerom.collect) { return "FunctionIcon/DoorLock/VideoDoorLockOpen.png"; } else { return "FunctionIcon/DoorLock/VideoDoorlockClose.png"; } } /// /// 保存本地文件 /// /// 当前设备 public void SaveFunctionFile(Function function) { if (function == null) return; function.AssembleStatus(); function.SaveFunctionFile(); FunctionList.List.IniFunctionList(function.savePath, true); MainPage.Log($"文件保存->{function.name}-->{function.spk}"); } /// /// 删除本地文件 /// /// 当前设备 public void DeleteFunction(Function function) { if (function == null) return; FunctionList.List.DeleteFunction(function); MainPage.Log($"文件删除->{function.name}-->{function.spk}"); } /// /// 获取萤石视频门锁列表 /// /// public List GetVideoDoorLockList() { var list = FunctionList.List.GetVideoDoorLockList(); #if DEBUG //list.Add(new Function { name = "视频门锁一", sid = "23456789", spk = SPK.VideoDoorLock }); //list.Add(new Function { name = "视频门锁二", sid = "2345678922", spk = SPK.VideoDoorLock }); #endif return list; } /// /// 弹框类型 /// public enum TipType { none,//无提示 flicker,//闪烁框 confirmation//确认框 } } }