/// <summary>取得 點位資料中的最大序號</summary> /// <returns></returns> private int GetPositionInstancesMaxSn() { if (PositionInstances == null || !PositionInstances.Any()) { return((int)NumUdpSn.Minimum - 1); } else { var maxSn = PositionInstances.Max(m => m.Sn); return(maxSn); } }
/// <summary>點位資料的 序號 是否存在</summary> /// <param name="sn">序號</param> /// <returns></returns> private bool IsSnExist(int sn) { if (PositionInstances == null || !PositionInstances.Any()) { return(false); } else { var inst = PositionInstances.Where(m => m.Sn == sn).FirstOrDefault(); if (inst == null) { return(false); } else { return(true); } } }