public override async Task <INuGetResource> Create(SourceRepository source)
        {
            INuGetResource         resource = null;
            PSAutoCompleteResource v2PowerShellAutoCompleteResource;

            if (!_cache.TryGetValue(source.PackageSource, out v2PowerShellAutoCompleteResource))
            {
                resource = await base.Create(source);

                if (resource != null)
                {
                    v2PowerShellAutoCompleteResource = new V2PowerShellAutoCompleteResource((V2Resource)resource);
                    _cache.TryAdd(source.PackageSource, v2PowerShellAutoCompleteResource);
                    resource = v2PowerShellAutoCompleteResource;
                }
                else
                {
                    resource = null;
                }
            }
            else
            {
                resource = v2PowerShellAutoCompleteResource;
            }

            return(resource);
        }
 public override async System.Threading.Tasks.Task<Resource> Create(PackageSource source)
 {
     var resource = await base.Create(source);
     if (resource != null)
     {
         var vsV2SearchResource = new V2PowerShellAutoCompleteResource((V2Resource)resource);
         return vsV2SearchResource;
     }
     else
     {
         return null;
     }
 }
예제 #3
0
        public override async System.Threading.Tasks.Task <Resource> Create(PackageSource source)
        {
            var resource = await base.Create(source);

            if (resource != null)
            {
                var vsV2SearchResource = new V2PowerShellAutoCompleteResource((V2Resource)resource);
                return(vsV2SearchResource);
            }
            else
            {
                return(null);
            }
        }