Example #1
0
        }// WizBack

        protected override int WizNext(IntPtr hwnd)
        {
            int nIndex      = GetPropPage(hwnd);
            int nReturnCode = -1;
            int nPageToGo   = 0;

            switch (nIndex)
            {
            case 0:
                // If we don't have any evidence, then something is wrong...
                if (m_ev == null || !Page1.HaveCurrentEvidence)
                {
                    m_ev = Page1.GetEvidence();
                    // Their assembly is bogus... don't let them leave this page
                    if (m_ev == null)
                    {
                        return(-1);
                    }
                    NewEvidenceReceived(m_ev);
                }

                Thread tImportant = m_fGetPermissions?m_tPermissionSet:m_tCodegroup;
                // Now give this thread top priority so it can get done with what
                // it needs to do
                SetThreadPriority(tImportant, ThreadPriority.Highest);
                tImportant.Join();

                // If they want to jump to page 3....
                if (!Page1.ShowPermissions)
                {
                    if (m_cgMatchingCodeGroups == null)
                    {
                        // This is screwy. If that's the case, then our thread completed
                        // but didn't do anything. We'll do the codegroup evaulation on
                        // this thread.
                        CreateGrantedCodegroups();
                    }

                    if (m_fCGErrors)
                    {
                        MessageBox(m_sCGErrorMessage,
                                   CResourceStore.GetString("CEvalAssemWizard:ErrorTitle"),
                                   MB.ICONEXCLAMATION);
                        return(-1);
                    }

                    if (Page3.Init(Page1.Filename, Page1.PolicyLevel, m_cgMatchingCodeGroups))
                    {
                        nPageToGo = 2;
                    }
                }
                else
                {
                    if (m_fPermErrors)
                    {
                        MessageBox(m_sPermErrorMessage,
                                   CResourceStore.GetString("CEvalAssemWizard:ErrorTitle"),
                                   MB.ICONEXCLAMATION);
                        return(-1);
                    }


                    if (Page2.Init(Page1.Filename, Page1.PolicyLevel, m_psGrantedPermissionSet))
                    {
                        nPageToGo = 1;
                    }
                }
                SendMessage(GetParent(hwnd), PSM.SETCURSEL, (IntPtr)nPageToGo, (IntPtr)(-1));
                break;
            }
            int nBaseRet = base.WizNext(hwnd);

            if (nBaseRet == 0)
            {
                return(nReturnCode);
            }
            else
            {
                return(nBaseRet);
            }
        }// WizNext