Exemplo n.º 1
0
        private void BindActionToActionPanel(ProgressOperationAction action)
        {
            var button = actionPanel.Add(new Button()
            {
                Text = action.DisplayName, Tag = action
            });

            button.Pressed.SubscribeForLifetime(action.Action, button);
        }
Exemplo n.º 2
0
        private void UnbindActionToActionPanel(ProgressOperationAction action)
        {
            var toRemove = actionPanel.Controls.Where(c => c.Tag == action).SingleOrDefault();

            if (toRemove == null)
            {
                throw new InvalidOperationException("No action to remove");
            }

            actionPanel.Controls.Remove(toRemove);
        }
Exemplo n.º 3
0
 private void Actions_Removed(ProgressOperationAction action)
 {
     UnbindActionToActionPanel(action);
 }
Exemplo n.º 4
0
 private void Actions_Added(ProgressOperationAction action)
 {
     BindActionToActionPanel(action);
 }
 private void BindActionToActionPanel(ProgressOperationAction action)
 {
     var button = actionPanel.Add(new Button() { Text = action.DisplayName, Tag = action });
     button.Pressed.SubscribeForLifetime(action.Action, button.LifetimeManager);
 }
 private void Actions_Removed(ProgressOperationAction action)
 {
     UnbindActionToActionPanel(action);
 }
 private void Actions_Added(ProgressOperationAction action)
 {
     BindActionToActionPanel(action);
 }
        private void UnbindActionToActionPanel(ProgressOperationAction action)
        {
            var toRemove = actionPanel.Controls.Where(c => c.Tag == action).SingleOrDefault();
            if (toRemove == null)
            {
                throw new InvalidOperationException("No action to remove");
            }

            actionPanel.Controls.Remove(toRemove);
        }