/// <summary> /// /// </summary> /// <param name="type"></param> /// <param name="nodeID"></param> /// <returns>如果NodeID为0则始终不返回NULL</returns> public PointAction GetPointAction(string type, int nodeID) { if (this.ContainsKey(type.ToLower() + "-" + nodeID)) { return(this.GetValue(type.ToLower() + "-" + nodeID)); } if (nodeID > 0) { PointActionType pointActionType = PointActionManager.GetPointActionType(type); NodeItem item = pointActionType.NodeItemList.GetValue(nodeID); if (item == null) { return(null); } else { return(GetPointAction(type, item.ParentID)); } } return(new PointAction()); }
public void ClearExperiesData() { //return; PointActionCollection pointActions = new PointActionCollection(); foreach (PointAction pointAction in PointActions) { PointActionType pointActionType = PointActionManager.GetPointActionType(pointAction.Type); if (pointActionType == null) { continue; } //检查nodeID if (pointActionType.HasNodeList && pointAction.NodeID != 0) { bool isExperies = true; foreach (NodeItem item in pointActionType.NodeItemList) { if (item.NodeID == pointAction.NodeID) { isExperies = false; break; } } if (isExperies) { continue; } } PointAction tempPointAction = new PointAction(); //检查roleID PointActionItemCollection pointActionItems = new PointActionItemCollection(); foreach (PointActionItem pointActionItem in pointAction.PointActionItems) { if (pointActionItem.RoleID == Guid.Empty || AllSettings.Current.RoleSettings.Roles.GetValue(pointActionItem.RoleID) != null) { pointActionItems.Add(pointActionItem); } } tempPointAction.PointActionItems = pointActionItems; tempPointAction.NodeID = pointAction.NodeID; tempPointAction.Type = pointAction.Type; pointActions.Add(tempPointAction); } PointActionSettings setting = new PointActionSettings(); setting.PointActions = pointActions; try { SettingManager.SaveSettings(setting); } catch { } }