47 lines
1.5 KiB
C#
47 lines
1.5 KiB
C#
using Cowain.Bake.Model;
|
||
using System;
|
||
using System.Collections.Concurrent;
|
||
using System.Collections.Generic;
|
||
using System.Threading;
|
||
|
||
namespace Cowain.Bake.Common.Core
|
||
{
|
||
|
||
public class CommonCoreHelper
|
||
{
|
||
|
||
//IsCompleted:true,CompleteAdding()已被调用(表示不再有新项添加)该集合是否已被标记为“添加完成”(即 CompleteAdding() 已被调用)
|
||
public BlockingCollection<TTaskRecord> BlockTask = new BlockingCollection<TTaskRecord>();
|
||
public BlockingCollection<TDeviceConfig> BlockStatusColor = new BlockingCollection<TDeviceConfig>();
|
||
|
||
// 参数表示初始状态:true表示初始有信号,false表示初始无信号
|
||
|
||
public AutoResetEvent MainViewAutoEvent = new AutoResetEvent(true);
|
||
private static CommonCoreHelper instance;
|
||
|
||
public static CommonCoreHelper Instance
|
||
{
|
||
get
|
||
{
|
||
if (instance == null)
|
||
{
|
||
instance = new CommonCoreHelper();
|
||
}
|
||
return instance;
|
||
}
|
||
}
|
||
public List<string> StringToListConverter(string input)
|
||
{
|
||
string[] separators = { " ", ":", ",", ";" };
|
||
if (string.IsNullOrWhiteSpace(input))
|
||
{
|
||
return new List<string>();
|
||
}
|
||
string[] items = input.Split(separators, StringSplitOptions.RemoveEmptyEntries);
|
||
List<string> itemList = new List<string>(items);
|
||
return itemList;
|
||
}
|
||
|
||
}
|
||
}
|