using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BPASmartClient.Helper
{
public static class ExpandMethod
{
///
/// 获取布尔数组指定值得索引
///
/// 要获取索引的数组
/// 要获取索引的值
///
public static int GetIndex(this bool[] obj, bool value)
{
if (obj == null) return -1;
return Array.FindIndex(obj, p => p == value);
}
///
/// 获取字符串数组指定值得索引
///
/// 要获取索引的数组
/// 要获取索引的值
///
public static int GetIndex(this string[] obj, string value)
{
if (obj == null || value == null) return -1;
return Array.FindIndex(obj, p => p == value && p.Length > 0);
}
///
/// 委托回调
///
/// 要执行的委托
/// 委托回调
public static void Invoke(this Action action, Action callback)
{
if (action != null)
{
action();
if (callback != null) callback();
}
}
///
/// 委托回调
///
/// 要执行的委托
/// 要执行的委托的参数
/// 委托回调
public static void Invoke(this Action