Ejemplo n.º 1
0
        /**************************************************************************************************/
        private void ApplyPrefs()
        {
            if (currentPrefs != null)
            {
                pedigreeControl1.model.parameters.hideNonBloodRelatives = currentPrefs.GUIPreference_hideNonBloodRelatives;

                if (currentPrefs.GUIPreference_ShowLegend)
                {
                    pedigreeLegend1.CheckForEmpty();
                }
                else
                {
                    pedigreeLegend1.Visible = false;
                }

                pedigreeLegend1.Background   = currentPrefs.GUIPreference_LegendBackground;
                pedigreeLegend1.BorderStyle  = currentPrefs.GUIPreference_LegendBorder;
                pedigreeLegend1.LegendFont   = currentPrefs.GUIPreference_LegendFont;
                pedigreeLegend1.LegendRadius = currentPrefs.GUIPreference_LegendRadius;
                pedigreeComment1.Visible     = currentPrefs.GUIPreference_ShowComment;
                pedigreeComment1.Background  = currentPrefs.GUIPreference_CommentBackground;
                pedigreeComment1.BorderStyle = currentPrefs.GUIPreference_CommentBorder;
                pedigreeComment1.CommentFont = currentPrefs.GUIPreference_CommentFont;
                pedigreeTitleBlock1.Visible  = currentPrefs.GUIPreference_ShowTitle;
                pedigreeTitleBlock1.SetFonts(currentPrefs.GUIPreference_NameFont, currentPrefs.GUIPreference_UnitnumFont, currentPrefs.GUIPreference_DobFont);
                pedigreeTitleBlock1.NameVis     = currentPrefs.GUIPreference_ShowName;
                pedigreeTitleBlock1.MRNVis      = currentPrefs.GUIPreference_ShowUnitnum;
                pedigreeTitleBlock1.DOBVis      = currentPrefs.GUIPreference_ShowDob;
                pedigreeTitleBlock1.Spacing     = currentPrefs.GUIPreference_TitleSpacing;
                pedigreeTitleBlock1.BackColor   = currentPrefs.GUIPreference_TitleBackground;
                pedigreeTitleBlock1.BorderStyle = currentPrefs.GUIPreference_TitleBorder;
                pedigreeControl1.model.parameters.BackgroundBrush    = new SolidBrush(currentPrefs.GUIPreference_PedigreeBackground);
                pedigreeControl1.model.parameters.nameWidth          = currentPrefs.GUIPreference_nameWidth;
                pedigreeControl1.model.parameters.limitedEthnicity   = currentPrefs.GUIPreference_limitedEthnicity;
                pedigreeControl1.model.parameters.limitedNationality = currentPrefs.GUIPreference_limitedNationality;

                pedigreeLegend1.Location = new Point(currentPrefs.GUIPreference_LegendX, currentPrefs.GUIPreference_LegendY);

                if (!(currentPrefs.GUIPreference_LegendHeight == SessionManager.Instance.MetaData.SystemWideDefaultPedigreePrefs.GUIPreference_LegendHeight))
                {
                    pedigreeLegend1.Height = currentPrefs.GUIPreference_LegendHeight;
                }

                if (!(currentPrefs.GUIPreference_LegendWidth == SessionManager.Instance.MetaData.SystemWideDefaultPedigreePrefs.GUIPreference_LegendWidth))
                {
                    pedigreeLegend1.Width = currentPrefs.GUIPreference_LegendWidth;
                }
                pedigreeTitleBlock1.Location = new Point(currentPrefs.GUIPreference_TitleX, currentPrefs.GUIPreference_TitleY);
                pedigreeTitleBlock1.Height   = currentPrefs.GUIPreference_TitleHeight;
                pedigreeTitleBlock1.Width    = currentPrefs.GUIPreference_TitleWidth;

                pedigreeComment1.Location = new Point(currentPrefs.GUIPreference_CommentX, currentPrefs.GUIPreference_CommentY);
                pedigreeComment1.Height   = currentPrefs.GUIPreference_CommentHeight;
                pedigreeComment1.Width    = currentPrefs.GUIPreference_CommentWidth;

                foreach (PedigreeAnnotation pa in sysDefaultAnnotations)
                {
                    pedigreeSettingsForm1.SetPedigreeAnnotation(pa);
                }
                foreach (PedigreeAnnotation pa in currentPrefs.annotations)
                {
                    pedigreeSettingsForm1.SetPedigreeAnnotation(pa);
                }

                if (pedigreeControl1.model != null)
                {
                    pedigreeControl1.model.parameters.verticalSpacing = currentPrefs.GUIPreference_verticalSpacing;
                }
            }
            if (string.IsNullOrEmpty(proband.family_comment))
            {
                pedigreeComment1.Visible = false;
            }
        }