首次提交:添加src文件夹代码
This commit is contained in:
46
Cowain.Bake.Common/Core/CommonCoreHelper.cs
Normal file
46
Cowain.Bake.Common/Core/CommonCoreHelper.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user