コード例 #1
0
ファイル: WordformGoDlg.cs プロジェクト: sillsdev/WorldPad
        protected override void ReplaceMatchingItemsControl()
        {
            if (m_mediator == null)
            {
                return;
            }
            XmlNode xnWindow = (XmlNode)m_mediator.PropertyTable.GetValue("WindowConfiguration");

            if (xnWindow == null)
            {
                return;
            }
            m_configNode = xnWindow.SelectSingleNode("controls/parameters/guicontrol[@id=\"WordformsBrowseView\"]/parameters");
            if (m_configNode == null)
            {
                return;
            }
            m_stylesheet = SIL.FieldWorks.Common.Widgets.FontHeightAdjuster.StyleSheetFromMediator(m_mediator);
            this.SuspendLayout();
            panel1.SuspendLayout();

            Clerk.ActivateUI(false);
            m_flidFake = Clerk.VirtualFlid;
            BrowseViewer newMe = new SIL.FieldWorks.Common.Controls.BrowseViewer(m_configNode,
                                                                                 m_cache.LangProject.WordformInventoryOA.Hvo, m_flidFake, m_cache, m_mediator, Clerk.SortItemProvider);

            if (matchingEntries != null && Controls.Contains(matchingEntries))
            {
                CopyBasicControlInfo(matchingEntries, newMe);
                Controls.Remove(matchingEntries);
                if (matchingEntries is BrowseViewer)
                {
                    (this.matchingEntries as BrowseViewer).SelectionChanged -= new FwSelectionChangedEventHandler(matchingEntries_SelectionChanged);
                    (this.matchingEntries as BrowseViewer).SelectionMade    -= new FwSelectionChangedEventHandler(m_bvMatches_SelectionMade);
                }
                matchingEntries.Dispose();
            }

            this.matchingEntries = newMe;
            this.matchingEntries.SuspendLayout();
            //this.matchingEntries.Location = new Point(0, 0);
            //this.matchingEntries.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom |
            //	AnchorStyles.Right;
            this.matchingEntries.Name    = "m_bv";
            this.matchingEntries.TabStop = true;
            //this.matchingEntries.Dock = DockStyle.Fill;
            (this.matchingEntries as BrowseViewer).Sorter            = null;
            (this.matchingEntries as BrowseViewer).StyleSheet        = m_stylesheet;
            (this.matchingEntries as BrowseViewer).SelectionChanged += new FwSelectionChangedEventHandler(matchingEntries_SelectionChanged);
            (this.matchingEntries as BrowseViewer).SelectionMade    += new FwSelectionChangedEventHandler(m_bvMatches_SelectionMade);
            ResetTabOrder();
            this.Controls.Add(this.matchingEntries);
            this.matchingEntries.ResumeLayout();
            panel1.ResumeLayout(false);
            this.ResumeLayout();
        }
コード例 #2
0
ファイル: WordformGoDlg.cs プロジェクト: sillsdev/WorldPad
		protected override void ReplaceMatchingItemsControl()
		{
			if (m_mediator == null)
				return;
			XmlNode xnWindow = (XmlNode)m_mediator.PropertyTable.GetValue("WindowConfiguration");
			if (xnWindow == null)
				return;
			m_configNode = xnWindow.SelectSingleNode("controls/parameters/guicontrol[@id=\"WordformsBrowseView\"]/parameters");
			if (m_configNode == null)
				return;
			m_stylesheet = SIL.FieldWorks.Common.Widgets.FontHeightAdjuster.StyleSheetFromMediator(m_mediator);
			this.SuspendLayout();
			panel1.SuspendLayout();

			Clerk.ActivateUI(false);
			m_flidFake = Clerk.VirtualFlid;
			BrowseViewer newMe = new SIL.FieldWorks.Common.Controls.BrowseViewer(m_configNode,
				m_cache.LangProject.WordformInventoryOA.Hvo, m_flidFake, m_cache, m_mediator, Clerk.SortItemProvider);

			if (matchingEntries != null && Controls.Contains(matchingEntries))
			{
				CopyBasicControlInfo(matchingEntries, newMe);
				Controls.Remove(matchingEntries);
				if (matchingEntries is BrowseViewer)
				{
					(this.matchingEntries as BrowseViewer).SelectionChanged -= new FwSelectionChangedEventHandler(matchingEntries_SelectionChanged);
					(this.matchingEntries as BrowseViewer).SelectionMade -= new FwSelectionChangedEventHandler(m_bvMatches_SelectionMade);
				}
				matchingEntries.Dispose();
			}

			this.matchingEntries = newMe;
			this.matchingEntries.SuspendLayout();
			//this.matchingEntries.Location = new Point(0, 0);
			//this.matchingEntries.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom |
			//	AnchorStyles.Right;
			this.matchingEntries.Name = "m_bv";
			this.matchingEntries.TabStop = true;
			//this.matchingEntries.Dock = DockStyle.Fill;
			(this.matchingEntries as BrowseViewer).Sorter = null;
			(this.matchingEntries as BrowseViewer).StyleSheet = m_stylesheet;
			(this.matchingEntries as BrowseViewer).SelectionChanged += new FwSelectionChangedEventHandler(matchingEntries_SelectionChanged);
			(this.matchingEntries as BrowseViewer).SelectionMade += new FwSelectionChangedEventHandler(m_bvMatches_SelectionMade);
			ResetTabOrder();
			this.Controls.Add(this.matchingEntries);
			this.matchingEntries.ResumeLayout();
			panel1.ResumeLayout(false);
			this.ResumeLayout();
		}