//----------------------------------------------------------
        // GetNextRequest
        //----------------------------------------------------------
        public ApplicationMonikerRequest GetNextRequest(IAssemblyManifestImport ami)
        {
            FileType type;
            Uri      codebase;

            DependentFileInfo     dfi;
            DependentAssemblyInfo dai;

            // we can't do components for now.
            if (ami.GetFileType() == FileType.ComponentManifest)
            {
                return(null);
            }

            dfi = ami.GetNextDependentFileInfo();
            if (dfi != null)
            {
                codebase = new Uri(_appBase, dfi["name"]);
                type     = FileType.RawFile;
            }
            else
            {
                // Don't follow component dependencies.
//				if (ami.GetFileType() == FileType.ComponentManifest)
//					return null;

                dai = ami.GetNextDependentAssemblyInfo();
                if (dai != null)
                {
                    codebase = new Uri(_appBase, dai["codeBase"]);
                    type     = FileType.ComponentManifest;
                }
                else
                {
                    codebase = null;
                    type     = FileType.Unknown;
                }
            }

            if (codebase == null)
            {
                return(null);
            }

            ApplicationMonikerRequest request =
                (ApplicationMonikerRequest)ApplicationMonikerRequest.Create(codebase, _appBase, _appStorePath);

            request.type = type;

            return(request);
        }
        //----------------------------------------------------------
        // DoDownload
        //----------------------------------------------------------
        void DoDownload(Uri appManifestUri)
        {
            ApplicationMonikerRequest request =
                (ApplicationMonikerRequest)
                ApplicationMonikerRequest.Create(appManifestUri, _appBase, _appStorePath);

            request.type = FileType.ApplicationManifest;

            _jobTable[appManifestUri] = request;

            RequestState rs = new RequestState();

            rs.Request = request;

            IAsyncResult r = (IAsyncResult)request.BeginGetResponse(
                new AsyncCallback(RespCallback), rs);
        }
 //----------------------------------------------------------
 // ApplicationMoniker
 //----------------------------------------------------------
 public WebRequest Create(Uri uri)
 {
     return(ApplicationMonikerRequest.Create(uri, _appBase, _appStorePath));
 }