Exemplo n.º 1
0
        // If multiple nodes are selected and the method does not have the AllowMultiSelectionAttribute
        // attribute, disable the command.

        protected override void CommandUpdate(object target, CommandArrayInfo cinfo)
        {
            NodeCommandHandler nc = (NodeCommandHandler)target;

            base.CommandUpdate(target, cinfo);
            if (nc.MultipleSelectedNodes)
            {
                bool allowMultiArray         = false;
                ICommandArrayUpdateHandler h = ((ICommandArrayUpdateHandler)this).Next;
                while (h != null)
                {
                    if (h is AllowMultiSelectionAttribute)
                    {
                        allowMultiArray = true;
                        break;
                    }
                    h = h.Next;
                }
                if (!allowMultiArray)
                {
                    cinfo.Clear();
                }
            }
        }
Exemplo n.º 2
0
		public void AddCustomHandlers (ICommandUpdateHandler handlerChain, ICommandArrayUpdateHandler arrayHandlerChain)
		{
			this.customHandlerChain = handlerChain;
			this.customArrayHandlerChain = arrayHandlerChain;
		}
Exemplo n.º 3
0
		ICommandArrayUpdateHandler ChainHandler (ICommandArrayUpdateHandler chain, object attr)
		{
			ICommandArrayUpdateHandler h = attr as ICommandArrayUpdateHandler;
			if (h == null) return chain;
			h.Next = chain ?? DefaultCommandHandler.Instance;
			return h;
		}