本文整理汇总了C#中Estar.Common.Tools.NameObjectList.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# NameObjectList.Remove方法的具体用法?C# NameObjectList.Remove怎么用?C# NameObjectList.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Estar.Common.Tools.NameObjectList
的用法示例。
在下文中一共展示了NameObjectList.Remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: validateSate
/// <summary>
/// 验证状态信息,对状态对比变化时生成事件记录
/// </summary>
/// <param name="item">巡检项</param>
/// <param name="devid">控制器ID</param>
/// <param name="taginfo">状态信息tag标记值</param>
private string validateSate(string taginfo)
{
if (string.IsNullOrEmpty(taginfo))
return taginfo;
Dictionary<string, string[]> dictstate = new Dictionary<string, string[]>();
string[] alarm ={ "4号门报警", "3号门报警", "2号门报警", "1号门报警" };
dictstate.Add("报警", alarm);
alarm = new string[] { "火警", "无效刷卡", "联动报警", "非法闯入", "超时", "胁迫" };
dictstate.Add("警报", alarm);
alarm = new string[] { "芯片故障", "系统故障4", "时钟故障", "系统故障2", "系统故障1" };
dictstate.Add("故障", alarm);
alarm = new string[] { "按钮4状态", "按钮3状态", "按钮2状态", "按钮1状态" };
dictstate.Add("按钮", alarm);
alarm = new string[] { "门磁4状态", "门磁3状态", "门磁2状态", "门磁1状态" };
dictstate.Add("门磁", alarm);
alarm = new string[] { "继4状态", "继3状态", "继2状态", "继1状态" };
dictstate.Add("继电器", alarm);
//火警报警,WG板子使用火警事件记录来反映的
string strstate = this.getStateDoorCard(basefun.valtag(taginfo, "{刷卡卡号}"),
basefun.valtag(taginfo, "状态编号"), basefun.valtag(taginfo, "读卡器"));
if ("火警报警" == strstate)
{
taginfo = basefun.setvaltag(taginfo, "火警", "1");
foreach(string k in dictstate["报警"])
taginfo = basefun.setvaltag(taginfo, k, "1");
}
//检查前后状态改变;alarmmsg报警信息,isalarm当前是否报警改变
string msg = "", alarmmsg = "", msgsigal = "";
bool isalarm = false;
NameObjectList psevent = new NameObjectList();
psevent["控制器"] = this.devid;
DateTime dt = DateTime.MinValue;
try
{
psevent["时间"] = dt = Convert.ToDateTime(basefun.valtag(taginfo, "{当前时间}"));
}
catch { dt = DateTime.MinValue; }
if (dt < DateTime.Today.AddYears(-3) || dt > DateTime.Today.AddYears(3))
{
NameValueCollection datainfo = new NameValueCollection();
datainfo["操作"] = "巡检状态";
ServiceTool.LogMessage(taginfo, datainfo, EventLogEntryType.FailureAudit);
if (null == dtobj) return taginfo;
try { dt = Convert.ToDateTime(dtobj); }
catch { return taginfo; }
if (dt < DateTime.Today.AddYears(-3) || dt > DateTime.Today.AddYears(3))
return taginfo;
psevent["时间"] = dtobj;
}
else
dtobj = psevent["时间"];
alarm = new string[] { "警报", "报警", "故障", "按钮", "门磁", "继电器" };
foreach (string state in alarm)
{
//对比状态生成事件
psevent["事件"] = state;
string tagorgi = this.tagInfos[state];
string tagnews = "";
bool ischanged = false;
int inum = 5;
foreach (string st in dictstate[state])
{
inum--;
string valorg = basefun.valtag(tagorgi, st);
if (string.IsNullOrEmpty(valorg))
valorg = "0";
string valnew = basefun.valtag(taginfo, st);
tagnews = basefun.setvaltag(tagnews, st, valnew);
if ("警报" == state && "1" == valnew)
{
if (string.IsNullOrEmpty(alarmmsg))
alarmmsg = st;
else
alarmmsg += "," + st;
}
if (valorg == valnew && ("报警" != state || !isalarm))
continue;
ischanged = true;
if ("警报" == state) continue;
//处理事件
if ("报警" == state || "故障" == state)
{
if ("报警" == state)
{
psevent["编号"] = inum.ToString();
psevent["内容"] = st + "(" + alarmmsg + ")";
}
else
{
psevent.Remove("编号");
psevent["内容"] = st;
}
msg = basefun.setvaltag(msg, st, valnew);
try
//.........这里部分代码省略.........
示例2: validateSate
/// <summary>
/// 验证状态信息,对状态对比变化时生成事件记录
/// </summary>
/// <param name="item">巡检项</param>
/// <param name="devid">控制器ID</param>
/// <param name="taginfo">状态信息tag标记值</param>
private void validateSate(ListViewItem item, string devid, string taginfo, string Type)
{
if (null == item || string.IsNullOrEmpty(devid) || string.IsNullOrEmpty(taginfo))
return;
Dictionary<string, string[]> dictstate = new Dictionary<string, string[]>();
string[] alarm ={ "4号门报警", "3号门报警", "2号门报警", "1号门报警" };
dictstate.Add("报警", alarm);
alarm = new string[] { "火警", "无效刷卡", "联动报警", "非法闯入", "超时", "胁迫" };
dictstate.Add("警报", alarm);
alarm = new string[] { "芯片故障", "系统故障4", "时钟故障", "系统故障2", "系统故障1" };
dictstate.Add("故障", alarm);
alarm = new string[] { "按钮4状态", "按钮3状态", "按钮2状态", "按钮1状态" };
dictstate.Add("按钮", alarm);
alarm = new string[] { "门磁4状态", "门磁3状态", "门磁2状态", "门磁1状态" };
dictstate.Add("门磁", alarm);
alarm = new string[] { "继4状态", "继3状态", "继2状态", "继1状态" };
dictstate.Add("继电器", alarm);
//检查前后状态改变;alarmmsg报警信息,isalarm当前是否报警改变
string msg = "", alarmmsg = "";
bool isalarm = false;
NameObjectList psevent = new NameObjectList();
psevent["控制器"] = new Guid(devid);
psevent["时间"] = basefun.valtag(taginfo, "{当前时间}");
alarm = new string[] { "警报", "报警", "故障", "按钮", "门磁", "继电器" };
foreach (string state in alarm)
{
string filter = "控制器='{0}' and 类别='{1}'";
DataRow[] drs = this.tabStateDoor.Select(string.Format(filter, devid, state));
DataRow dr = null;
if (null == drs || drs.Length < 1)
{
dr = this.tabStateDoor.NewRow();
dr["控制器"] = devid;
dr["类别"] = state;
dr["更新日期"] = basefun.valtag(taginfo, "{刷卡时间}");
this.tabStateDoor.Rows.Add(dr);
}
else
dr = drs[0];
//对比状态生成事件
psevent["事件"] = state;
string tagorgi = Convert.ToString(dr["内容"]);
string tagnews = "";
bool ischanged = false;
int inum = 5;
foreach (string st in dictstate[state])
{
inum--;
string valorg = basefun.valtag(tagorgi, st);
if (string.IsNullOrEmpty(valorg))
valorg = "0";
string valnew = basefun.valtag(taginfo, st);
tagnews = basefun.setvaltag(tagnews, st, valnew);
if ("警报" == state && "1" == valnew)
{
if (string.IsNullOrEmpty(alarmmsg))
alarmmsg = st;
else
alarmmsg += "," + st;
}
if (valorg == valnew && ("报警" != state || !isalarm))
continue;
ischanged = true;
if ("警报" == state) continue;
//处理事件
if ("报警" == state || "故障" == state)
{
if ("报警" == state)
{
psevent["编号"] = inum.ToString();
psevent["内容"] = st + "(" + alarmmsg + ")";
msg += ";" + st + "(" + alarmmsg + ")";
}
else
{
psevent.Remove("编号");
psevent["内容"] = st;
msg += ";" + st;
}
if ("1" == valnew)
this.Query.ExecuteNonQuery("发生门禁事件", psevent, psevent, psevent);
else
this.Query.ExecuteNonQuery("结束门禁事件", psevent, psevent, psevent);
}
else
{
psevent["编号"] = inum.ToString();
psevent["内容"] = st + "变位 " + valnew;
// msg += ";" + st + "变位 " + valnew;
this.Query.ExecuteNonQuery("门禁变位事件", psevent, psevent, psevent);
}
}//foreach (string st in dictstate[state])
if (!ischanged) continue;
//.........这里部分代码省略.........
示例3: validateSate
/// <summary>
/// ��֤״̬��Ϣ,��״̬�Աȱ仯ʱ�����¼���¼
/// </summary>
/// <param name="item">Ѳ����</param>
/// <param name="devid">������ID</param>
/// <param name="taginfo">״̬��Ϣtag���ֵ</param>
private void validateSate(string taginfo)
{
if (string.IsNullOrEmpty(taginfo))
return;
Dictionary<string, string[]> dictstate = new Dictionary<string, string[]>();
string[] alarm ={ "4���ű���", "3���ű���", "2���ű���", "1���ű���" };
dictstate.Add("����", alarm);
alarm = new string[] { "��", "��Чˢ��", "��������", "�Ƿ�����", "��ʱ", "в��" };
dictstate.Add("����", alarm);
alarm = new string[] { "оƬ����", "ϵͳ����4", "ʱ�ӹ���", "ϵͳ����2", "ϵͳ����1" };
dictstate.Add("����", alarm);
alarm = new string[] { "��ť4״̬", "��ť3״̬", "��ť2״̬", "��ť1״̬" };
dictstate.Add("��ť", alarm);
alarm = new string[] { "�Ŵ�4״̬", "�Ŵ�3״̬", "�Ŵ�2״̬", "�Ŵ�1״̬" };
dictstate.Add("�Ŵ�", alarm);
alarm = new string[] { "��4״̬", "��3״̬", "��2״̬", "��1״̬" };
dictstate.Add("�̵���", alarm);
//���ǰ��״̬�ı䣻alarmmsg������Ϣ,isalarm��ǰ�Ƿ��ı�
string msg = "", alarmmsg = "", msgsigal = "";
bool isalarm = false;
NameObjectList psevent = new NameObjectList();
psevent["������"] = this.devid;
psevent["ʱ��"] = basefun.valtag(taginfo, "{��ǰʱ��}");
alarm = new string[] { "����", "����", "����", "��ť", "�Ŵ�", "�̵���" };
foreach (string state in alarm)
{
//�Ա�״̬�����¼�
psevent["�¼�"] = state;
string tagorgi = this.tagInfos[state];
string tagnews = "";
bool ischanged = false;
int inum = 5;
foreach (string st in dictstate[state])
{
inum--;
string valorg = basefun.valtag(tagorgi, st);
if (string.IsNullOrEmpty(valorg))
valorg = "0";
string valnew = basefun.valtag(taginfo, st);
tagnews = basefun.setvaltag(tagnews, st, valnew);
if ("����" == state && "1" == valnew)
{
if (string.IsNullOrEmpty(alarmmsg))
alarmmsg = st;
else
alarmmsg += "," + st;
}
if (valorg == valnew && ("����" != state || !isalarm))
continue;
ischanged = true;
if ("����" == state) continue;
//�����¼�
if ("����" == state || "����" == state)
{
if ("����" == state)
{
psevent["���"] = inum.ToString();
psevent["����"] = st + "(" + alarmmsg + ")";
}
else
{
psevent.Remove("���");
psevent["����"] = st;
}
msg = basefun.setvaltag(msg, st, valnew);
if ("1" == valnew)
this.query.ExecuteNonQuery("�����Ž��¼�", psevent, psevent, psevent);
else
this.query.ExecuteNonQuery("�����Ž��¼�", psevent, psevent, psevent);
}
else
{
psevent["���"] = inum.ToString();
psevent["����"] = st + "��λ " + valnew;
msgsigal = basefun.setvaltag(msgsigal, st, valnew);
this.query.ExecuteNonQuery("�Ž���λ�¼�", psevent, psevent, psevent);
}
}//foreach (string st in dictstate[state])
this.tagInfos[state] = tagnews;
if (!ischanged) continue;
psevent["���"] = state;
psevent["����"] = tagnews;
this.query.ExecuteNonQuery("�Ž�Ѳ��״̬", psevent, psevent, psevent);
//�������ݱ仯ʱ,�Ƚ���ԭ�����¼�
if ("����" == state)
{
isalarm = !string.IsNullOrEmpty(alarmmsg);
if (!isalarm)
{
foreach (string a in dictstate[state])
msg = basefun.setvaltag(msg, a, "0");
}
psevent.Remove("���");
//.........这里部分代码省略.........