Esempio n. 1
0
        /// <summary>
        /// Process the change in the checked result types and display corresponding data
        /// </summary>
        /// <param name="ctl"></param>

        private void CheckedChanged(
            CheckEdit ctl)
        {
            if (InSetup)
            {
                return;
            }

            try
            {
                InSetup = true;

                if (ctl == AllMatches)
                {
                    bool amc = AllMatches.Checked;
                    if (AltForms.Enabled)
                    {
                        AltForms.Checked = amc;
                    }
                    if (MatchedPairs.Enabled)
                    {
                        MatchedPairs.Checked = amc;
                    }
                    if (SimilarStructure.Enabled)
                    {
                        SimilarStructure.Checked = amc;
                    }
                    if (SmallWorld.Enabled)
                    {
                        SmallWorld.Checked = amc;
                    }

                    //if (SmallWorldAvailable) SmallWorld.Checked = AllMatches.Checked;
                    //else SmallWorld.Checked = false;
                }

                else
                {
                    bool allChecked =
                        (AltForms.Checked || !AltForms.Enabled) &&
                        (MatchedPairs.Checked || !MatchedPairs.Enabled) &&
                        (SimilarStructure.Checked || !SimilarStructure.Enabled) &&
                        (SmallWorld.Checked || !SmallWorld.Enabled);

                    //if (SmallWorldAvailable) allChecked = allChecked && SmallWorld.Checked;
                    AllMatches.Checked = allChecked;
                }

                Checkmarks = SerializeCheckmarks();         // save current settings

                MatchCountsPanel.Refresh();                 // redraw the counts grid

                if (RenderSearchResultsDelegate != null)
                {
                    DelayedCallback.Schedule(RenderSearchResultsDelegate);
                }

                return;
            }

            catch (Exception ex) { ex = ex; }

            finally { InSetup = false; }
        }