コード例 #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="T:KeyTermRenderingsControl"/> class.
        /// </summary>
        /// <param name="cache">The cache.</param>
        /// <param name="mainWnd">the FwMainWnd that owns this control.</param>
        /// ------------------------------------------------------------------------------------
        public KeyTermRenderingsControl(FdoCache cache, FwMainWnd mainWnd) : base(cache, mainWnd)
        {
            InitializeComponent();
            AccessibleName = Name;
            DataGridView   = m_dataGridView;

            // Setup columns
            m_Rendering.Cache             = m_cache;
            m_Rendering.WritingSystemCode = m_cache.DefaultVernWs;
            m_OriginalTerm.Cache          = m_cache;

            IWritingSystem ws;

            m_cache.ServiceLocator.WritingSystemManager.GetOrSet("grc", out ws);
            m_wsGreek = ws.Handle;
            if (m_wsGreek <= 0)
            {
                throw new Exception("The Greek writing system is not defined.");
            }
            m_cache.ServiceLocator.WritingSystemManager.GetOrSet("hbo", out ws);
            m_wsHebrew = ws.Handle;
            if (m_wsHebrew <= 0)
            {
                throw new Exception("The Hebrew writing system is not defined.");
            }

            if (mainWnd != null)
            {
                Parent           = mainWnd;
                m_stylesheet     = mainWnd.StyleSheet;
                m_Rendering.Font = m_stylesheet.GetUiFontForWritingSystem(cache.DefaultVernWs,
                                                                          FontInfo.kDefaultFontSize);
            }

            m_list       = new List <ICheckGridRowObject>();
            m_gridSorter = new CheckGridListSorter(m_list);
            m_gridSorter.AddComparer(m_Rendering.DataPropertyName, m_tsStrComparer);
            m_gridSorter.AddComparer(m_OriginalTerm.DataPropertyName, m_tsStrComparer);
            m_gridSorter.AddComparer(m_Status.DataPropertyName, new RenderingStatusComparer());
            m_gridSorter.AddComparer(m_Reference.DataPropertyName,
                                     new ScriptureReferenceComparer(m_cache.LanguageProject.TranslatedScriptureOA.ScrProjMetaDataProvider));

            m_dataGridView.Cache = m_cache;
            m_dataGridView.ColumnHeaderMouseClick += m_dataGridView_ColumnHeaderMouseClick;
        }
コード例 #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="T:KeyTermRenderingsControl"/> class.
        /// </summary>
        /// <param name="cache">The cache.</param>
        /// <param name="mainWnd">the FwMainWnd that owns this control.</param>
        /// ------------------------------------------------------------------------------------
        public KeyTermRenderingsControl(FdoCache cache, FwMainWnd mainWnd) : base(cache, mainWnd)
        {
            InitializeComponent();
            DataGridView = m_dataGridView;

            // Setup columns
            m_Rendering.Cache             = m_cache;
            m_Rendering.WritingSystemCode = m_cache.DefaultVernWs;
            m_OriginalTerm.Cache          = m_cache;

            ILgWritingSystemFactory wsf = m_cache.LanguageWritingSystemFactoryAccessor;

            m_wsGreek = wsf.GetWsFromStr("grc");
            if (m_wsGreek <= 0)
            {
                throw new Exception("The Greek writing system is not defined.");
            }
            m_wsHebrew = wsf.GetWsFromStr("hbo");
            if (m_wsHebrew <= 0)
            {
                throw new Exception("The Hebrew writing system is not defined.");
            }

            if (mainWnd != null)
            {
                Parent           = mainWnd;
                m_stylesheet     = mainWnd.StyleSheet;
                m_Rendering.Font = new Font(
                    m_stylesheet.GetNormalFontFaceName(cache, cache.DefaultVernWs),
                    FontInfo.kDefaultFontSize / 1000);
            }

            m_list       = new List <ICheckGridRowObject>();
            m_gridSorter = new CheckGridListSorter(m_list);
            m_gridSorter.AddComparer(m_Rendering.DataPropertyName, m_tsStrComparer);
            m_gridSorter.AddComparer(m_OriginalTerm.DataPropertyName, m_tsStrComparer);
            m_gridSorter.AddComparer(m_Status.DataPropertyName, new RenderingStatusComparer());
            m_gridSorter.AddComparer(m_Reference.DataPropertyName,
                                     new ScriptureReferenceComparer((Scripture)m_cache.LangProject.TranslatedScriptureOA));

            m_dataGridView.Cache = m_cache;
            m_dataGridView.ColumnHeaderMouseClick += m_dataGridView_ColumnHeaderMouseClick;
        }