示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CommandPreviousTrack"/> class.
        /// Adds our command handlers for menu (commands must exist in the command table file)
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        private CommandPreviousTrack(Package package)
        {
            if (package == null)
            {
                throw new ArgumentNullException("package");
            }

            this.package = package;
            SpotifyRemote spotifyRemotePackage = package as SpotifyRemote;

            m_spotifyManager = spotifyRemotePackage.GetSpotifyManager();

            OleMenuCommandService commandService = this.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            OleMenuCommand        menuItem       = null;

            if (commandService != null)
            {
                var menuCommandID = new CommandID(CommandSet, CommandId);
                menuItem = new OleMenuCommand(this.MenuItemCallback, menuCommandID);
                commandService.AddCommand(menuItem);
            }

            SettingsManager setManager = SettingsManager.GetSettingsManager();

            setManager.SetTbButtonPrevious(ref menuItem);
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SpotifyRemote"/> class.
        /// </summary>
        public SpotifyRemote()
        {
            // Inside this method you can place any initialization code that does not require
            // any Visual Studio service because at this point the package object is created but
            // not sited yet inside Visual Studio environment. The place to do all the other
            // initialization is the Initialize method.


            SettingsManager sm = new SettingsManager();

            SettingsManager.ProvideSettingsManager(ref sm);

            m_spotifyManager = new SpotifyManager();
            sm.SetSpotifyManager(ref m_spotifyManager);
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CommandOpenSpotify"/> class.
        /// Adds our command handlers for menu (commands must exist in the command table file)
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        private CommandOpenSpotify(Package package)
        {
            if (package == null)
            {
                throw new ArgumentNullException("package");
            }
            SpotifyRemote spotifyRemotePackage = package as SpotifyRemote;

            m_spotifyManager = spotifyRemotePackage.GetSpotifyManager();


            this.package = package;

            OleMenuCommandService commandService = this.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            OleMenuCommand        menuItem       = null;

            if (commandService != null)
            {
                var menuCommandID = new CommandID(CommandSet, CommandId);
                menuItem = new OleMenuCommand(this.MenuItemCallback, menuCommandID);
                commandService.AddCommand(menuItem);
            }



            // Initialize TrackChangeAnimator.
            m_trackChangeAnimator = new TrackChangeAnimator();
            m_trackChangeAnimator.Initialize(menuItem, m_currentTextlabel);

            m_spotifyManager.SpotifyClientTrackChange += SpotifyClientTrackChange;


            SettingsManager setManager = SettingsManager.GetSettingsManager();

            setManager.SetTbButtonOpen(ref menuItem);
            setManager.SetTrackChangeAnimation(ref m_trackChangeAnimator);
        }
示例#4
0
 public void SetSpotifyManager(ref SpotifyManager spotifyManager)
 {
     m_spotifyManager = spotifyManager;
 }