Beispiel #1
0
        /// <summary>
        /// Change root of Sandbox or create it; Lay it out and figure its size;
        /// tell m_vc the size.
        /// </summary>
        /// <returns></returns>
        private void ChangeOrCreateSandbox(AnalysisOccurrence selected)
        {
            this.SuspendLayout();
            panelSandbox.SuspendLayout();
            if (InterlinDoc != null)
            {
                InterlinDoc.RecordGuessIfNotKnown(selected);
            }
            int color = (int)CmObjectUi.RGB(DefaultBackColor);

            //if this sandbox is presenting a wordform with multiple possible analyses then set the
            //bg color indicator
            if (selected.Analysis.Analysis == null && selected.Analysis.Wordform != null &&
                SandboxBase.GetHasMultipleRelevantAnalyses(selected.Analysis.Wordform))
            {
                color = InterlinVc.MultipleApprovedGuessColor;
            }

            if (m_sandbox == null)
            {
                m_sandbox = CreateNewSandbox(selected);
                m_sandbox.MultipleAnalysisColor = color;
            }
            else
            {
                //set the color before switching so that the color is correct when DisplayWordForm is called
                m_sandbox.MultipleAnalysisColor = color;
                m_sandbox.SwitchWord(selected);
            }
            UpdateButtonState();
            // add the sandbox plus some padding.
            panelSandbox.ResumeLayout();
            this.ResumeLayout();

            SetSandboxSize();
        }
		/// <summary>
		/// Change root of Sandbox or create it; Lay it out and figure its size;
		/// tell m_vc the size.
		/// </summary>
		/// <returns></returns>
		private void ChangeOrCreateSandbox(AnalysisOccurrence selected)
		{
			this.SuspendLayout();
			panelSandbox.SuspendLayout();
			if (InterlinDoc != null)
			{
				InterlinDoc.RecordGuessIfNotKnown(selected);
			}
			int color = (int)CmObjectUi.RGB(DefaultBackColor);
			//if this sandbox is presenting a wordform with multiple possible analyses then set the
			//bg color indicator
			if (selected.Analysis.Analysis == null && selected.Analysis.Wordform != null &&
				SandboxBase.GetHasMultipleRelevantAnalyses(selected.Analysis.Wordform))
			{
				color = InterlinVc.MultipleApprovedGuessColor;
			}

			if (m_sandbox == null)
			{
				m_sandbox = CreateNewSandbox(selected);
				m_sandbox.MultipleAnalysisColor = color;
			}
			else
			{
				//set the color before switching so that the color is correct when DisplayWordForm is called
				m_sandbox.MultipleAnalysisColor = color;
				m_sandbox.SwitchWord(selected);
			}
			UpdateButtonState();
			// add the sandbox plus some padding.
			panelSandbox.ResumeLayout();
			this.ResumeLayout();

			SetSandboxSize();
		}