当前位置: 首页>>代码示例>>C#>>正文


C# IRequest.Debug方法代码示例

本文整理汇总了C#中IRequest.Debug方法的典型用法代码示例。如果您正苦于以下问题:C# IRequest.Debug方法的具体用法?C# IRequest.Debug怎么用?C# IRequest.Debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IRequest的用法示例。


在下文中一共展示了IRequest.Debug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CompleteFind

 /// <summary>
 /// Finalizes a batch search request.
 /// </summary>
 /// <param name="id"></param>
 /// <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>
 /// <returns></returns>
 public void CompleteFind(int id, IRequest request)
 {
     // TODO: improve this debug message that tells us what's going on.
     request.Debug("Calling '{0}::CompleteFind' '{1}'", PackageProviderName, id);
     // TODO: batch search implementation
 }
开发者ID:PowerShell,项目名称:SmartPackageProvider,代码行数:12,代码来源:SmartProvider.cs

示例2: UninstallPackage

        /// <summary>
        /// Uninstalls a package 
        /// </summary>
        /// <param name="fastPackageReference"></param>
        /// <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 UninstallPackage(string fastPackageReference, IRequest request)
        {
            request.Debug("Calling '{0}::UninstallPackage' '{1}'", PackageProviderName, fastPackageReference);

            string source;
            string id;
            string version;
            if (!fastPackageReference.TryParseFastPath(out source, out id, out version))
            {
                request.Error(ErrorCategory.InvalidArgument, fastPackageReference, Strings.InvalidFastPath, fastPackageReference);
            }

            // TODO: uninstall
        }
开发者ID:PowerShell,项目名称:SmartPackageProvider,代码行数:19,代码来源:SmartProvider.cs

示例3: AddPackageSource

 /// <summary>
 /// This is called when the user is adding (or updating) a package source
 /// </summary>
 /// <param name="name">The name of the package source. If this parameter is null or empty the PROVIDER should use the location as the name (if the PROVIDER actually stores names of package sources)</param>
 /// <param name="location">The location (ie, directory, URL, etc) of the package source. If this is null or empty, the PROVIDER should use the name as the location (if valid)</param>
 /// <param name="trusted">A boolean indicating that the user trusts this package source. Packages returned from this source should be marked as 'trusted'</param>
 /// <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 AddPackageSource(string name, string location, bool trusted, IRequest request)
 {
     request.Debug("Calling '{0}::AddPackageSource' '{1}','{2}','{3}'", PackageProviderName, name, location, trusted);
     ProviderStorage.AddPackageSource(name, location, trusted, request);
 }
开发者ID:PowerShell,项目名称:SmartPackageProvider,代码行数:12,代码来源:SmartProvider.cs

示例4: ResolvePackageSources

        /// <summary>
        /// Resolves and returns Package Sources to the client.
        /// 
        /// Specified sources are passed in via the request object (<c>request.GetSources()</c>). 
        /// 
        /// Sources are returned using <c>request.YieldPackageSource(...)</c>
        /// </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 ResolvePackageSources(IRequest request)
        {
            request.Debug("Calling '{0}::ResolvePackageSources'", PackageProviderName);

            if (request.Sources.Any())
            {
                // the system is requesting sources that match the values passed.
                // if the value passed can be a legitimate source, but is not registered, return a package source marked unregistered.
                var packageSources = ProviderStorage.GetPackageSources(request);

                if (request.IsCanceled)
                {
                    return;
                }

                foreach (var source in request.Sources.AsNotNull())
                {
                    if (packageSources.ContainsKey(source))
                    {
                        var packageSource = packageSources[source];

                        // YieldPackageSource returns false when operation was cancelled
                        if (!request.YieldPackageSource(packageSource.Name, packageSource.Location, packageSource.Trusted, packageSource.IsRegistered, packageSource.IsValidated))
                        {
                            return;
                        }
                    }
                    else
                    {
                        request.Warning("Package Source '{0}' not found.", source);
                    }
                }
            }
            else
            {
                // the system is requesting all the registered sources
                var packageSources = ProviderStorage.GetPackageSources(request);
                foreach (var entry in packageSources.AsNotNull())
                {
                    var packageSource = entry.Value;

                    // YieldPackageSource returns false when operation was cancelled
                    if (!request.YieldPackageSource(packageSource.Name, packageSource.Location, packageSource.Trusted, packageSource.IsRegistered, packageSource.IsValidated))
                    {
                        return;
                    }
                }
            }
        }
开发者ID:PowerShell,项目名称:SmartPackageProvider,代码行数:57,代码来源:SmartProvider.cs

示例5: StartFind

        /// <summary>
        /// Initializes a batch search request.
        /// </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>
        /// <returns></returns>
        public int StartFind(IRequest request)
        {
            // TODO: improve this debug message that tells us what's going on.
            request.Debug("Calling '{0}::StartFind'", PackageProviderName);

            // TODO: batch search implementation
            return default(int);
        }
开发者ID:PowerShell,项目名称:SmartPackageProvider,代码行数:13,代码来源:SmartProvider.cs

示例6: FindPackageByFile

 /// <summary>
 /// Finds packages given a locally-accessible filename
 /// 
 /// Package information must be returned using <c>request.YieldPackage(...)</c> function.
 /// </summary>
 /// <param name="file">the full path to the file to determine if it is a package</param>
 /// <param name="id">if this is greater than zero (and the number should have been generated using <c>StartFind(...)</c>, the core is calling this multiple times to do a batch search request. The operation can be delayed until <c>CompleteFind(...)</c> is called</param>
 /// <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 FindPackageByFile(string file, int id, IRequest request)
 {
     request.Debug("Calling '{0}::FindPackageByFile' '{1}','{2}'", PackageProviderName, file, id);
 }
开发者ID:PowerShell,项目名称:SmartPackageProvider,代码行数:12,代码来源:SmartProvider.cs

示例7: RemovePackageSource

 /// <summary>
 /// Removes/Unregisters a package source
 /// </summary>
 /// <param name="name">The name or location of a package source to remove.</param>
 /// <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 RemovePackageSource(string name, IRequest request)
 {
     request.Debug("Calling '{0}::RemovePackageSource' '{1}'", PackageProviderName, name);
     ProviderStorage.RemovePackageSource(name, request);
 }
开发者ID:PowerShell,项目名称:SmartPackageProvider,代码行数:10,代码来源:SmartProvider.cs

示例8: GetPackageDetails

        /// <summary>
        /// 
        /// </summary>
        /// <param name="fastPackageReference"></param>
        /// <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 GetPackageDetails(string fastPackageReference, IRequest request)
        {
            // TODO: improve this debug message that tells us what's going on.
            request.Debug("Calling '{0}::GetPackageDetails' '{1}'", PackageProviderName, fastPackageReference);

            // TODO: This method is for fetching details that are more expensive than FindPackage* (if you don't need that, remove this method)
        }
开发者ID:PowerShell,项目名称:SmartPackageProvider,代码行数:12,代码来源:SmartProvider.cs

示例9: InitializeProvider

 /// <summary>
 /// Performs one-time initialization of the $provider.
 /// </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 InitializeProvider(IRequest request)
 {
     request.Debug("Calling '{0}::InitializeProvider'", PackageProviderName);
 }
开发者ID:PowerShell,项目名称:SmartPackageProvider,代码行数:8,代码来源:SmartProvider.cs

示例10: GetInstalledPackages

        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <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 GetInstalledPackages(string name, string requiredVersion, string minimumVersion, string maximumVersion, IRequest request)
        {
            // TODO: improve this debug message that tells us what's going on.
            request.Debug("Calling '{0}::GetInstalledPackages' '{1}'", PackageProviderName, name);

            // TODO: list all installed packages
        }
开发者ID:PowerShell,项目名称:SmartPackageProvider,代码行数:12,代码来源:SmartProvider.cs

示例11: GetPackageDependencies

 /// <summary>
 /// THIS API WILL BE DEPRECATED
 /// Returns package references for all the dependent packages
 /// This is called by Find-Package -IncludeDependencies and returned as a flat list
 /// As well as Install-Package -WhatIf
 /// </summary>
 /// <param name="fastPackageReference"></param>
 /// <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 GetPackageDependencies(string fastPackageReference, IRequest request)
 {
     request.Debug("Calling '{0}::GetPackageDependencies' '{1}'", PackageProviderName, fastPackageReference);
 }
开发者ID:PowerShell,项目名称:SmartPackageProvider,代码行数:12,代码来源:SmartProvider.cs

示例12: GetFeatures

        /// <summary>
        /// Returns a collection of strings to the client advertising 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(IRequest request)
        {
            request.Debug("Calling '{0}::GetFeatures' ", PackageProviderName);

            foreach (var feature in Features)
            {
                request.Yield(feature);
            }
        }
开发者ID:PowerShell,项目名称:SmartPackageProvider,代码行数:13,代码来源:SmartProvider.cs

示例13: GetDynamicOptions

        /// <summary>
        /// Returns dynamic option definitions to the HOST
        ///
        /// example response:
        ///     request.YieldDynamicOption( "MySwitch", OptionType.String.ToString(), false);
        ///
        /// </summary>
        /// <param name="category">The category of dynamic options that the HOST is interested in</param>
        /// <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 GetDynamicOptions(string category, IRequest 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", "String", false);
                    //request.YieldDynamicOption("SkipValidate", Constants.OptionType.Switch, false);
                    break;

                // applies to Get-Package, Install-Package, Uninstall-Package
                case "install":
                    request.YieldDynamicOption("Destination", "Folder", false);
                    //request.YieldDynamicOption("SkipDependencies", Constants.OptionType.Switch, false);
                    //request.YieldDynamicOption("ContinueOnFailure", Constants.OptionType.Switch, false);
                    //request.YieldDynamicOption("ExcludeVersion", Constants.OptionType.Switch, false);
                    break;
                default:
                    request.Debug("Unknown category for '{0}::GetDynamicOptions': {1}", PackageProviderName, category);
                    break;
            }
        }
开发者ID:PowerShell,项目名称:SmartPackageProvider,代码行数:38,代码来源:SmartProvider.cs

示例14: FindPackageByUri

 /// <summary>
 /// Finds packages given a URI. 
 /// 
 /// The function is responsible for downloading any content required to make this work
 /// 
 /// Package information must be returned using <c>request.YieldPackage(...)</c> function.
 /// </summary>
 /// <param name="uri">the URI the client requesting a package for.</param>
 /// <param name="id">if this is greater than zero (and the number should have been generated using <c>StartFind(...)</c>, the core is calling this multiple times to do a batch search request. The operation can be delayed until <c>CompleteFind(...)</c> is called</param>
 /// <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 FindPackageByUri(Uri uri, int id, IRequest request)
 {
     request.Debug("Calling '{0}::FindPackageByUri' '{1}','{2}'", PackageProviderName, uri, id);
 }
开发者ID:PowerShell,项目名称:SmartPackageProvider,代码行数:14,代码来源:SmartProvider.cs

示例15: DownloadPackage

        /// <summary>
        /// Downloads a remote package file to a local location.
        /// </summary>
        /// <param name="fastPackageReference"></param>
        /// <param name="location"></param>
        /// <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 DownloadPackage(string fastPackageReference, string location, IRequest request)
        {
            request.Debug("Calling '{0}::DownloadPackage' '{1}','{2}'", PackageProviderName, fastPackageReference, location);

            string source;
            string id;
            string version;
            if (!fastPackageReference.TryParseFastPath(out source, out id, out version))
            {
                request.Error(ErrorCategory.InvalidArgument, fastPackageReference, Strings.InvalidFastPath);
            }

            // TODO: download
        }
开发者ID:PowerShell,项目名称:SmartPackageProvider,代码行数:20,代码来源:SmartProvider.cs


注:本文中的IRequest.Debug方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。