예제 #1
0
        public ObjectOperatorCollection GetOperator(ObjectOperateRightEventArgs e)
        {
            if (e.Style.Style == PageStyle.List)
            {
                if (e.MainObj == null)
                {
                    if (fOperators.Contains(UpdateKind.Insert))
                    {
                        return(new ObjectOperatorCollection(RightConst.INSERT));
                    }
                    return(null);
                }
                else
                {
                    List <string> result = new List <string>(2);
                    if (fOperators.Contains(UpdateKind.Update))
                    {
                        result.Add(RightConst.UPDATE);
                    }
                    if (fOperators.Contains(UpdateKind.Delete))
                    {
                        result.Add(RightConst.DELETE);
                    }
                    if (result.Count == 0)
                    {
                        return(null);
                    }
                    return(new ObjectOperatorCollection(result));
                }
            }

            return(null);
        }
예제 #2
0
        public ObjectOperatorCollection GetOperator(ObjectOperateRightEventArgs e)
        {
            if (e.MainObj == null)
            {
                return(null);
            }
            ObjectContainer container = e.MainObj as ObjectContainer;

            if (container == null)
            {
                return(null);
            }
            ITreeNode node = container.MainObject as ITreeNode;

            if (node == null)
            {
                return(null);
            }

            ObjectOperatorCollection result = new ObjectOperatorCollection(fOtherOperators);

            result.Add(RightConst.INSERT);
            result.Add(RightConst.UPDATE);

            if (DisableRootDelete)
            {
                if (node.HasParent)
                {
                    result.Add(RightConst.DELETE);
                }
            }
            else
            {
                result.Add(RightConst.DELETE);
            }

            return(result);
        }