示例#1
0
        public void GetDynamicOptions(string category, NuGetRequest request)
        {
            request.Debug("Calling '{0}::GetDynamicOptions' '{1}'", PackageProviderName, category);

            switch ((category ?? string.Empty).ToLowerInvariant())
            {
            case "package":
                request.YieldDynamicOption("FilterOnTag", Constants.OptionType.StringArray, false);
                request.YieldDynamicOption("Contains", Constants.OptionType.String, false);
                request.YieldDynamicOption("AllowPrereleaseVersions", Constants.OptionType.Switch, false);
                break;

            case "source":
                request.YieldDynamicOption("ConfigFile", Constants.OptionType.String, false);
                request.YieldDynamicOption("SkipValidate", Constants.OptionType.Switch, false);
                break;

            case "install":
                request.YieldDynamicOption("Destination", Constants.OptionType.Path, true);
                request.YieldDynamicOption("SkipDependencies", Constants.OptionType.Switch, false);
                request.YieldDynamicOption("ContinueOnFailure", Constants.OptionType.Switch, false);
                request.YieldDynamicOption("ExcludeVersion", Constants.OptionType.Switch, false);
                request.YieldDynamicOption("PackageSaveMode", Constants.OptionType.String, false, new[] {
                    "nuspec", "nupkg", "nuspec;nupkg"
                });
                break;
            }
        }
示例#2
0
        public void InitializeProvider(NuGetRequest request)
        {
            Features.AddOrSet("exe", new[] {
                Assembly.GetAssembly(typeof(PackageSource)).Location
            });

            // create a strongly-typed request object.
            // Nice-to-have put a debug message in that tells what's going on.
            request.Debug("Calling '{0}::InitializeProvider'", PackageProviderName);
        }
示例#3
0
 /// <summary>
 ///     Returns a collection of strings to the client advertizing features this provider supports.
 /// </summary>
 /// <param name="request">
 ///     An object passed in from the CORE that contains functions that can be used to interact with the
 ///     CORE and HOST
 /// </param>
 public void GetFeatures(NuGetRequest request)
 {
     // Nice-to-have put a debug message in that tells what's going on.
     request.Debug("Calling '{0}::GetFeatures' ", PackageProviderName);
     request.Yield(Features);
 }