Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var actions = new Dictionary<string, Action>();
- actions.Add("Lucene (Suche) Service neustarten", restartApp);
- foreach (KeyValuePair<string, Action> entry in actions)
- {
- // do something with entry.Value or entry.Key
- Debug.WriteLine(entry.Key);
- Debug.WriteLine(entry.Value);
- Delegate dicFunc = new Action(() => entry.Value());
- Button action_button = new Button();
- action_button.Text = entry.Key;
- action_button.Click += new EventHandler(dicFunc);
- groupBox_article_actions.Controls.Add(action_button);
- }
- void restartApp()
- {
- MessageBox.Show("Restarted");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement