コード例 #1
0
        private void promptForSampleJSON(PackageSourceListRequest request)
        {
            var    srcs = request.SelectedSources;
            string userSpecifiedProvider = request.GetOptionValue("ProviderName") ?? request.GetOptionValue("Provider");
            bool   providerNameSpecified = !string.IsNullOrWhiteSpace(userSpecifiedProvider) && Constants.ProviderName.EqualsIgnoreCase(userSpecifiedProvider);

            if ((srcs == null || srcs.Count() == 0) && providerNameSpecified)
            {
                request.PromptAndDownloadSampleJSON();
            }
        }