public void alterDepth(Guid guid, DepthModel model) { addrConfig loc_addrConfig; if (list_addrInfo.Count > 0 && list_addrInfo.Exists(q => q.addrModel.guid == guid)) { loc_addrConfig = list_addrInfo.First(q => q.addrModel.guid == guid); if (loc_addrConfig.list_depthInfo != null && loc_addrConfig.list_depthInfo.Count > 0 && loc_addrConfig.list_depthInfo.Exists(q => q.depthModel.depth == model.depth)) { DepthInfo loc_depthInfo = loc_addrConfig.list_depthInfo.First(q => q.depthModel.depth == model.depth); DepthInfo depthInfo = new DepthInfo(); depthInfo.depthModel = model; depthInfo.list_links = new List <LinkInfo>(); int index = list_addrInfo.FindIndex(q => q.addrModel.guid == guid); list_addrInfo[index].list_depthInfo.Remove(loc_depthInfo); list_addrInfo[index].list_depthInfo.Add(depthInfo); saveAddrInfo(); RefreshDepth(); } else { if (list_addrInfo.Count > 0 && list_addrInfo.Exists(q => q.addrModel.guid == guid)) { loc_addrConfig = list_addrInfo.First(q => q.addrModel.guid == guid); int index = list_addrInfo.IndexOf(loc_addrConfig); if (loc_addrConfig.list_depthInfo == null) { loc_addrConfig.list_depthInfo = new List <DepthInfo>(); } DepthModel loc_depthModel;// = loc_addrConfig.list_depthInfo.OrderBy(q => q.depthModel.depth).Last().depthModel; if (loc_addrConfig.list_depthInfo.Count > 0) { loc_depthModel = loc_addrConfig.list_depthInfo.OrderBy(q => q.depthModel.depth).Last().depthModel; model.depth = loc_depthModel.depth + 1; } else { model.depth = 1; } DepthInfo depthInfo = new DepthInfo(); depthInfo.depthModel = model; depthInfo.list_links = new List <LinkInfo>(); if (loc_addrConfig.list_depthInfo == null) { loc_addrConfig.list_depthInfo.Add(depthInfo); list_addrInfo.RemoveAt(index); list_addrInfo.Insert(index, loc_addrConfig); } list_addrInfo[index].list_depthInfo.Add(depthInfo); saveAddrInfo(); RefreshDepth(); } } } }
public editDepth(Guid _guid, DepthModel depthModel = new DepthModel()) { InitializeComponent(); guid = _guid; model = depthModel; tb_prefix.Text = model.prefix; nud_depth.Value = model.depth; nud_maxActionSpan.Value = model.maxActionSpan; nud_maxWndCount.Value = model.maxWndCount; nud_minActionSpan.Value = model.minActionSpan; nud_minLastTime.Value = model.minLastTime; nud_maxLastTime.Value = model.maxLastTime; nud_maxVisitTimes.Value = model.visitTimesLimit; }
public void addDepth(Guid guid, DepthModel model) { if (list_addrInfo.Count > 0 && list_addrInfo.Exists(q => q.addrModel.guid == guid)) { addrConfig loc_addrConfig = list_addrInfo.First(q => q.addrModel.guid == guid); DepthModel loc_depthModel = loc_addrConfig.list_depthInfo.OrderBy(q => q.depthModel.depth).Last().depthModel; model.depth = loc_depthModel.depth + 1; DepthInfo depthInfo = new DepthInfo(); depthInfo.depthModel = model; depthInfo.list_links = new List <LinkInfo>(); list_addrInfo[list_addrInfo.FindIndex(q => q.addrModel.guid == guid)].list_depthInfo.Add(depthInfo); saveAddrInfo(); RefreshDepth(); } }