Debug() public abstract method

public abstract Debug ( string messageText ) : bool
messageText string
return bool
 public void GetFeatures(Request request)
 {
     request.Debug("Calling '{0}::GetFeatures'", PackageProviderName);
     request.Yield(new Dictionary<string, string[]>
     {
         [Constants.Features.SupportedExtensions] = new[] {"xml"},
         [Constants.Features.SupportedSchemes] = new[] {"http", "https", "file"}
     });
 }
        public void GetDynamicOptions(string category, Request request)
        {
            request.Debug("Calling '{0}::GetDynamicOptions'", PackageProviderName);
            switch ((category ?? string.Empty).ToLowerInvariant())
            {
                case "package":
                    request.YieldDynamicOption("Refresh", Constants.OptionType.Switch, isRequired: false);
                    request.YieldDynamicOption("AllVersions", Constants.OptionType.Switch, isRequired: false);
                    request.YieldDynamicOption("GlobalSearch", Constants.OptionType.Switch, isRequired: false);
                    break;

                case "install":
                    request.YieldDynamicOption("Refresh", Constants.OptionType.Switch, isRequired: false);
                    request.YieldDynamicOption("DeferDownload", Constants.OptionType.Switch, isRequired: false);
                    request.YieldDynamicOption("Scope", Constants.OptionType.String, isRequired: false, permittedValues: new[] { "CurrentUser", "AllUsers" });
                    break;

                case "source":
                    break;
            }
        }
 public void InitializeProvider(Request request)
 {
     request.Debug("Calling '{0}::InitializeProvider'", PackageProviderName);
 }
 public void GetInstalledPackages(string name, string requiredVersion, string minimumVersion, string maximumVersion, Request request)
 {
     request.Debug("Calling '{0}::GetInstalledPackages'", PackageProviderName);
     Do(request, x => x.GetInstalledPackages(name));
 }
 public void GetPackageDetails(string fastPackageReference, Request request)
 {
     request.Debug("Calling '{0}::GetPackageDetails'", PackageProviderName);
     Do(request, x => x.GetPackageDetails(fastPackageReference));
 }
 public void DownloadPackage(string fastPackageReference, string location, Request request)
 {
     request.Debug("Calling '{0}::DownloadPackage'", PackageProviderName);
     if (string.IsNullOrEmpty(location))
     {
         request.Error(ErrorCategory.InvalidArgument, "location", "Location parameter missing");
         return;
     }
     Do(request, x => x.DownloadPackage(fastPackageReference, location));
 }
 public void UninstallPackage(string fastPackageReference, Request request)
 {
     request.Debug("Calling '{0}::UninstallPackage'", PackageProviderName);
     Do(request, x => x.UninstallPackage(fastPackageReference));
 }
 public void FindPackageByFile(string file, int id, Request request)
 {
     request.Debug("Calling '{0}::FindPackageByFile'", PackageProviderName);
     if (string.IsNullOrEmpty(file))
     {
         request.Error(ErrorCategory.InvalidArgument, "file", "File parameter missing");
         return;
     }
     Do(request, x => x.FindPackageBy(file));
 }
 public void FindPackageByUri(Uri uri, int id, Request request)
 {
     request.Debug("Calling '{0}::FindPackageByUri'", PackageProviderName);
     if (uri == null)
     {
         request.Error(ErrorCategory.InvalidArgument, "uri", "Uri parameter missing");
         return;
     }
     Do(request, x => x.FindPackageBy(uri.OriginalString));
 }
Esempio n. 10
0
 public void FindPackage(string name, string requiredVersion, string minimumVersion, string maximumVersion, int id, Request request)
 {
     request.Debug("Calling '{0}::FindPackage'", PackageProviderName);
     Do(request, x => x.FindPackage(name, requiredVersion, minimumVersion, maximumVersion));
 }
Esempio n. 11
0
        public void RemovePackageSource(string name, Request request)
        {
            request.Debug("Calling '{0}::RemovePackageSource'", PackageProviderName);
            if (string.IsNullOrEmpty(name))
            {
                request.Error(ErrorCategory.InvalidArgument, "name", "Name parameter missing");
                return;
            }

            Do(request, x => x.RemovePackageSource(name));
        }
Esempio n. 12
0
 public void AddPackageSource(string name, string location, bool trusted, Request request)
 {
     request.Debug("Calling '{0}::AddPackageSource'", PackageProviderName);
     if (string.IsNullOrEmpty(location))
     {
         request.Error(ErrorCategory.InvalidArgument, "location", "Location parameter missing");
         return;
     }
     Do(request, x => x.AddPackageSource(location));
 }
Esempio n. 13
0
 public void ResolvePackageSources(Request request)
 {
     request.Debug("Calling '{0}::ResolvePackageSources'", PackageProviderName);
     Do(request, x => x.ResolvePackageSources());
 }
 /// <summary>
 /// Creates a <see cref="OneGetCommand"/> instance and executes a delegate on it, handling common exception types.
 /// </summary>
 private void Do(Request request, Action<OneGetCommand> action, [CallerMemberName] string caller = null)
 {
     request.Debug("Calling '{0}::{1}'", PackageProviderName, caller);
     try
     {
         using (var command = BuildCommand(request))
             action(command);
     }
         #region Error handling
     catch (OperationCanceledException)
     {}
     catch (FormatException ex)
     {
         request.Error(ErrorCategory.InvalidArgument, "", ex.Message);
     }
     catch (WebException ex)
     {
         request.Error(ErrorCategory.ConnectionError, "", ex.Message);
     }
     catch (NotSupportedException ex)
     {
         request.Error(ErrorCategory.NotImplemented, "", ex.Message);
     }
     catch (IOException ex)
     {
         request.Error(ErrorCategory.OpenError, "", ex.Message);
     }
     catch (UnauthorizedAccessException ex)
     {
         request.Error(ErrorCategory.PermissionDenied, "", ex.Message);
     }
     catch (InvalidDataException ex)
     {
         request.Error(ErrorCategory.InvalidData, "", ex.Message);
     }
     catch (SignatureException ex)
     {
         request.Error(ErrorCategory.MetadataError, "", ex.Message);
     }
     catch (DigestMismatchException ex)
     {
         request.Error(ErrorCategory.MetadataError, "", ex.Message);
     }
     catch (SolverException ex)
     {
         request.Error(ErrorCategory.MetadataError, "", ex.Message);
     }
     catch (ExecutorException ex)
     {
         request.Error(ErrorCategory.MetadataError, "", ex.Message);
     }
     catch (ConflictException ex)
     {
         request.Error(ErrorCategory.MetadataError, "", ex.Message);
     }
     #endregion
 }