lixiaojun
2024-12-10 8d7b513f8546ed1f48fe9f4586cf5b2ea2794a3e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Yw.WinFrmUI
{
    /// <summary>
    /// 
    /// </summary>
    public static class HydroMonitorExtensions
    {
        /// <summary>
        /// 匹配
        /// </summary>
        public static HydroMonitorVmo Matching(this List<HydroMonitorVmo> allMonitorList, string propName, List<string> flags)
        {
            if (allMonitorList == null || allMonitorList.Count < 1)
            {
                return default;
            }
            allMonitorList = allMonitorList.Where(x => x.PropName == propName).ToList();
            allMonitorList = allMonitorList.OrderBy(x => x.Flags.Distinct().Count()).ToList();
            return allMonitorList.Find(x => x.Flags.ContainsC(flags));
        }
 
 
 
 
 
    }
}