예제 #1
0
 public UninstallSuggestedAction(SuggestedActionProvider provider, ILibraryCommandService libraryCommandService)
     : base(provider.TextBuffer, provider.TextView, GetDisplayText(provider), Guid)
 {
     _libraryCommandService = libraryCommandService;
     _provider   = provider;
     IconMoniker = KnownMonikers.Cancel;
 }
예제 #2
0
        private static string GetDisplayText(SuggestedActionProvider provider)
        {
            ILibraryInstallationState state = provider.InstallationState;
            string cleanId = LibraryIdToNameAndVersionConverter.Instance.GetLibraryId(state.Name, state.Version, state.ProviderId);

            if (cleanId.Length > MaxLength + 10)
            {
                cleanId = $"...{cleanId.Substring(cleanId.Length - MaxLength)}";
            }

            return(string.Format(Resources.Text.UninstallLibrary, cleanId));
        }
        public UpdateSuggestedAction(SuggestedActionProvider provider, string libraryId, string displayText, bool disabled = false)
            : base(provider.TextBuffer, provider.TextView, displayText, Guid)
        {
            _provider         = provider;
            _updatedLibraryId = libraryId;
            _disabled         = disabled;

            if (!disabled)
            {
                IconMoniker = KnownMonikers.StatusReady;
            }
        }
 public UpdateSuggestedActionSet(SuggestedActionProvider provider)
     : base(provider.TextBuffer, provider.TextView, Resources.Text.CheckForUpdates, Guid)
 {
     _provider = provider;
 }