public override bool IsEquivalentTo(ActionNodeEntityHandler other)
        {
            if (other.GetType() != GetType())
            {
                return(false);
            }

            return(Action.ActionID == ((ActionEntityHandler)other).Action.ActionID);
        }
        public override bool IsEquivalentTo(ActionNodeEntityHandler other)
        {
            if (other.GetType() != GetType())
            {
                return(false);
            }

            return(AreEquivalent(ChildHandlers, ((BranchActionEntityHandler)other).ChildHandlers));
        }
        private void UpdateActionModel(bool notify)
        {
            DisposeActionHandlers();
            _actionHandlers.AddRange(ActionNodeEntityHandler.Create(_viewer.ToolbarModel.ChildNodes));
            if (!notify)
            {
                return;
            }

            NotifyEntityPropertyChanged("ToolbarActions", GetToolbarActionEntities());
        }
        public static List <ActionNodeEntityHandler> Create(ActionModelNodeList nodes)
        {
            var handlers = new List <ActionNodeEntityHandler>();

            foreach (ActionModelNode node in nodes)
            {
                //TODO (CR May 2010): remove the try/catch and let it crash?
                try
                {
                    ActionNodeEntityHandler handler = Create(node);
                    if (handler != null)
                    {
                        handlers.Add(handler);
                    }
                }
                catch (Exception e)
                {
                    Platform.Log(LogLevel.Error, e,
                                 "Unexpected exception processing action node: {0}", node);
                }
            }

            return(handlers);
        }
 public override bool IsEquivalentTo(ActionNodeEntityHandler other)
 {
     return(base.IsEquivalentTo(other) &&
            AreEquivalent(ChildHandlers, ((DropDownActionEntityHandler)other).ChildHandlers));
 }
 public abstract bool IsEquivalentTo(ActionNodeEntityHandler other);
示例#7
0
 public ContextMenuContainer(ActionModelNode modelNode)
 {
     _contextMenuHandlers = ActionNodeEntityHandler.Create(modelNode.ChildNodes);
 }