Exemple #1
0
 private void LoadItems()
 {
     for (int i = 0; i < App.vimageConfig.CustomActions.Count; i++)
     {
         CustomActionItem item = new CustomActionItem(i, CustomActionItems);
         CustomActionItems.Children.Add(item);
     }
 }
Exemple #2
0
        private CustomActionItem AddCustomActionItem(string name = "", string func = "", int position = -1)
        {
            CustomActionItem item = new CustomActionItem(name, func);

            panel_CustomActions.Controls.Add(item);
            panel_CustomActions.Controls.SetChildIndex(item, 0);

            CustomActionItems.Add(item);
            item.AddConfigWindowReference(this);

            return(item);
        }
Exemple #3
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            int index = CustomActionItems.Children.Count;

            App.vimageConfig.CustomActions.Add(new { name = "ACTION", func = "" });
            App.vimageConfig.CustomActionBindings.Add(new { name = "ACTION", bindings = new List <int>() });

            CustomActionItem item = new CustomActionItem(index, CustomActionItems);

            CustomActionItems.Children.Add(item);

            // update controls tab
            (Application.Current.MainWindow as MainWindow).ControlBindings.AddCustomActionBinding(index);
            // update context menu function list
            (Application.Current.MainWindow as MainWindow).ContextMenuEditor.UpdateCustomActions();
        }
Exemple #4
0
        private CustomActionItem AddCustomActionItem(string name = "", string func = "", int position = -1)
        {
            CustomActionItem item = new CustomActionItem(name, func);

            panel_CustomActions.Controls.Add(item);
            panel_CustomActions.Controls.SetChildIndex(item, 0);

            CustomActionItems.Add(item);
            item.AddConfigWindowReference(this);

            return item;
        }