Exemple #1
0
        private void BindMergeAction(PopupWindowShowAction pswAction)
        {
            IActionControlsSite     site      = Frame.Template as IActionControlsSite;
            IActionControlContainer container = GetTargetActionContainer(site, pswAction);

            if (container != null && container.FindActionControl(pswAction.Id) == null)
            {
                if (bAddAction)
                {
                    // Action noch nicht da
                    ISimpleActionControl actionControl = container.AddSimpleActionControl(pswAction.Id);
                    actionControl.NativeControlDisposed += ActionControl_NativeControlDisposed;
                    ActionBinding actionBinding = ActionBindingFactory.Instance.Create(pswAction, actionControl);
                    if (!dictBinding.ContainsKey(pswAction))
                    {
                        dictBinding.Add(pswAction, actionBinding);
                    }
                }
            }
            if (container != null && container.FindActionControl(pswAction.Id) == null)
            {
                if (bAddAction)
                {
                    if (!dictBinding.ContainsKey(pswAction))
                    {
                        ISimpleActionControl actionControl = container.AddSimpleActionControl(pswAction.Id);
                        actionControl.NativeControlDisposed += ActionControl_NativeControlDisposed;
                        ActionBinding actionBinding = ActionBindingFactory.Instance.Create(pswAction, actionControl);
                        dictBinding.Add(pswAction, actionBinding);
                    }
                }
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ConsoleSimpleActionBinding"/> class.
 /// </summary>
 /// <param name="action">The action.</param>
 /// <param name="actionControl">The action control.</param>
 public ConsoleSimpleActionBinding(SimpleAction action, ISimpleActionControl actionControl)
     : base(action, actionControl) => Action.HandleException += Action_HandleException;