コード例 #1
0
ファイル: MenuItem.cs プロジェクト: mokhan/mo.money
        public MenuItem(string name, Action command, HybridIcon icon, ShortcutKey key, Func<bool> can_be_clicked)
        {
            this.can_be_clicked = can_be_clicked;

            item = new ToolStripMenuItem(name)
                       {
                           Image = icon,
                           ShortcutKeys = key,
                           Enabled = can_be_clicked()
                       };
            item.Click += (o, e) => command();

            task_tray_item = new System.Windows.Forms.MenuItem(name) {ShowShortcut = true, Enabled = can_be_clicked()};
            task_tray_item.Click += (o, e) => command();
        }
コード例 #2
0
ファイル: ShortcutKey.cs プロジェクト: mokhan/mo.money
 public ShortcutKey and(ShortcutKey other_key)
 {
     return new ShortcutKey(key | other_key.key);
 }