コード例 #1
0
        public object Clone()
        {
            PointActionSettings setting = new PointActionSettings();

            setting.PointActions = PointActions;

            return(setting);
        }
コード例 #2
0
        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
            { }
        }
コード例 #3
0
        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
            { }
        }
コード例 #4
0
        public object Clone()
        {
            PointActionSettings setting = new PointActionSettings();
            setting.PointActions = PointActions;

            return setting;
        }