本文整理汇总了C#中PackageManager.FlushCache方法的典型用法代码示例。如果您正苦于以下问题:C# PackageManager.FlushCache方法的具体用法?C# PackageManager.FlushCache怎么用?C# PackageManager.FlushCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PackageManager
的用法示例。
在下文中一共展示了PackageManager.FlushCache方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
/// <summary>
/// The (non-static) startup method
/// </summary>
/// <param name = "args">
/// The command line arguments.
/// </param>
/// <returns>
/// Process return code.
/// </returns>
protected override int Main(IEnumerable<string> args)
{
try {
_pkgManager = new PackageManager();
bool waitforbreak = false;
#region commane line parsing
// default:
_pkgManager.SessionFeedLocations = new[] {Environment.CurrentDirectory};
var options = args.Switches();
var parameters = args.Parameters();
foreach (var arg in options.Keys) {
var argumentParameters = options[arg];
switch (arg) {
/* options */
case "pretend":
_pkgManager.Pretend = true;
break;
case "wait-for-break":
waitforbreak = true;
break;
case "maximum":
_pkgManager.MaximumPackagesToProcess = argumentParameters.Last().ToInt32(10);
break;
case "as-specified":
_pkgManager.PackagesAsSpecified = string.IsNullOrEmpty(argumentParameters.FirstOrDefault())
? new[] {"*"}
: argumentParameters;
break;
case "upgrade":
_pkgManager.PackagesAreUpgradable = string.IsNullOrEmpty(argumentParameters.FirstOrDefault())
? new[] {"*"}
: argumentParameters;
break;
case "no-scan":
_pkgManager.DoNotScanLocations = string.IsNullOrEmpty(argumentParameters.FirstOrDefault())
? new[] {"*"}
: argumentParameters;
break;
case "no-network":
_pkgManager.DoNotScanLocations = new[] {"*://*"};
break;
case "scan":
if (string.IsNullOrEmpty(argumentParameters.FirstOrDefault())) {
throw new ConsoleException(Resources.OptionRequiresLocation.format("--scan"));
}
_pkgManager.SessionFeedLocations = argumentParameters;
break;
case "flush-cache":
_pkgManager.FlushCache();
break;
/* global switches */
case "load-config":
// all ready done, but don't get too picky.
break;
case "nologo":
this.Assembly().SetLogo(string.Empty);
break;
case "feed-output-file":
_feedOutputFile = argumentParameters.LastOrDefault();
break;
case "feed-root-url":
_feedRootUrl = argumentParameters.LastOrDefault();
break;
case "feed-actual-url":
_feedActualUrl = argumentParameters.LastOrDefault();
break;
case "feed-package-source":
_feedPackageSource = argumentParameters.LastOrDefault();
break;
case "feed-recursive":
_feedRecursive = true;
break;
case "feed-package-url":
_feedPackageUrl = argumentParameters.LastOrDefault();
//.........这里部分代码省略.........