Exemple #1
0
        // Present the user with a detailed list of installable components.
        // The components marked if they are schedule for installation.
        // The use can select/unselect individual files for installation.
        bool GetApprovalForInstallation(string targetRepository)
        {
            InstallationPreviewDialog preview = new InstallationPreviewDialog();

            preview.TargetRepository = targetRepository;

            SortedList <string, object> candidateSources = new SortedList <string, object>();

            // Build the set of available components, marked if they are
            // scheduled for installation.
            foreach (string type in m_Candidates.Keys)
            {
                List <InstallationCandidate> candidateList = m_Candidates[type];

                foreach (InstallationCandidate candidate in candidateList)
                {
                    if (!candidateSources.ContainsKey(candidate.Source.Name))
                    {
                        candidateSources.Add(candidate.Source.Name, null);

                        preview.Add(candidate.Destination, IsTypeEnabled(type));
                    }
                }
            }

            return(BuildApprovedList(preview));
        }
Exemple #2
0
        private bool BuildApprovedList(InstallationPreviewDialog preview)
        {
            m_ApprovedForInstallation = new Dictionary <string, object>();

            if (ConfirmInstallation)
            {
                if (DialogResult.OK != preview.ShowDialog())
                {
                    return(false);
                }
            }

            foreach (string approvedItem in preview.CheckedItems)
            {
                m_ApprovedForInstallation.Add(approvedItem, null);
            }

            return(true);
        }
        // Present the user with a detailed list of installable components.
        // The components marked if they are schedule for installation.
        // The use can select/unselect individual files for installation.
        bool GetApprovalForInstallation( string targetRepository )
        {
            InstallationPreviewDialog preview = new InstallationPreviewDialog();

            preview.TargetRepository = targetRepository;

            SortedList<string,object> candidateSources = new SortedList<string, object>();

            // Build the set of available components, marked if they are
            // scheduled for installation.
            foreach( string type in m_Candidates.Keys )
            {
                List<InstallationCandidate> candidateList = m_Candidates[ type ];

                foreach( InstallationCandidate candidate in candidateList )
                {
                    if( ! candidateSources.ContainsKey( candidate.Source.Name ) )
                    {
                        candidateSources.Add( candidate.Source.Name, null );

                        preview.Add( candidate.Destination, IsTypeEnabled( type ) );
                    }
                }
            }

            return BuildApprovedList( preview );
        }
        private bool BuildApprovedList( InstallationPreviewDialog preview )
        {
            m_ApprovedForInstallation = new Dictionary<string, object>();

            if( ConfirmInstallation )
            {
                if( DialogResult.OK != preview.ShowDialog() )
                {
                    return false;
                }
            }

            foreach( string approvedItem in preview.CheckedItems )
            {
                m_ApprovedForInstallation.Add( approvedItem, null );
            }

            return true;
        }