コード例 #1
0
        protected override ContextMenuStrip CreateMenu()
        {
            var explorerMenu  = new ContextMenuStrip();
            var extensionMenu = new ToolStripMenuItem(Language.Open_under_Display_Profile,
                                                      Properties.Resources.Icon_x16);

            if (Profile.GetAllProfiles().Any())
            {
                Profile.RefreshActiveStatus();

                foreach (var profile in Profile.GetAllProfiles())
                {
                    extensionMenu.DropDownItems.Add(CreateProfileMenu(profile));
                }

                extensionMenu.DropDownItems.Add(new ToolStripSeparator());
            }

            extensionMenu.DropDownItems.Add(new ToolStripMenuItem(Language.Manage_Profiles,
                                                                  Properties.Resources.Icon_x16,
                                                                  (sender, args) =>
            {
                HeliosDisplayManagement.Open();
            }));
            explorerMenu.Items.Add(extensionMenu);
            explorerMenu.Items.Add(new ToolStripSeparator());

            return(explorerMenu);
        }
コード例 #2
0
        private static ToolStripMenuItem CreateProfileMenu(Profile profile)
        {
            var profileMenu = new ToolStripMenuItem(profile.Name, new ProfileIcon(profile).ToBitmap(16, 16));

            profileMenu.DropDownItems.Add(new ToolStripMenuItem(Language.Apply, Properties.Resources.Run_x16,
                                                                (sender, args) => HeliosDisplayManagement.Open(HeliosStartupAction.SwitchProfile, profile))
            {
                Enabled = profile.IsPossible && !profile.IsActive
            });
            profileMenu.DropDownItems.Add(new ToolStripSeparator());
            profileMenu.DropDownItems.Add(new ToolStripMenuItem(Language.Edit, Properties.Resources.Edit_x16,
                                                                (sender, args) => HeliosDisplayManagement.Open(HeliosStartupAction.EditProfile, profile)));
            profileMenu.DropDownItems.Add(new ToolStripMenuItem(Language.Create_Shortcut,
                                                                Properties.Resources.Shortcut_x16,
                                                                (sender, args) => HeliosDisplayManagement.Open(HeliosStartupAction.CreateShortcut, profile)));
            return(profileMenu);
        }
        private ToolStripMenuItem CreateProfileMenu(Profile profile)
        {
            var appId       = ParseSteamAppId();
            var profileMenu = new ToolStripMenuItem(profile.Name, new ProfileIcon(profile).ToBitmap(16, 16));

            profileMenu.DropDownItems.Add(new ToolStripMenuItem(Language.Run, null,
                                                                (sender, args) =>
                                                                HeliosDisplayManagement.OpenSteamGame(HeliosStartupAction.SwitchProfile, profile,
                                                                                                      appId)));
            profileMenu.DropDownItems.Add(new ToolStripSeparator());
            profileMenu.DropDownItems.Add(new ToolStripMenuItem(Language.Create_Shortcut, null,
                                                                (sender, args) =>
                                                                HeliosDisplayManagement.OpenSteamGame(HeliosStartupAction.CreateShortcut, profile,
                                                                                                      appId)));

            return(profileMenu);
        }
コード例 #4
0
        private ToolStripMenuItem CreateProfileMenu(Profile profile)
        {
            var profileMenu = new ToolStripMenuItem(profile.Name, new ProfileIcon(profile).ToBitmap(16, 16));

            profileMenu.DropDownItems.Add(new ToolStripMenuItem(Language.Run, null,
                                                                (sender, args) =>
                                                                HeliosDisplayManagement.Open(HeliosStartupAction.SwitchProfile, profile,
                                                                                             SelectedItemPaths.FirstOrDefault())));
            profileMenu.DropDownItems.Add(new ToolStripMenuItem(Language.Run_as_administrator, Shield.SmallIcon,
                                                                (sender, args) =>
                                                                HeliosDisplayManagement.Open(HeliosStartupAction.SwitchProfile, profile,
                                                                                             SelectedItemPaths.FirstOrDefault(), true)));
            profileMenu.DropDownItems.Add(new ToolStripSeparator());
            profileMenu.DropDownItems.Add(new ToolStripMenuItem(Language.Create_Shortcut, null,
                                                                (sender, args) =>
                                                                HeliosDisplayManagement.Open(HeliosStartupAction.CreateShortcut, profile,
                                                                                             SelectedItemPaths.FirstOrDefault())));

            return(profileMenu);
        }