SIL.FieldWorks.IText.FocusBoxController.CreateNewSandbox C# (CSharp) Method

CreateNewSandbox() private method

private CreateNewSandbox ( AnalysisOccurrence selected ) : IAnalysisControlInternal
selected AnalysisOccurrence
return IAnalysisControlInternal
		internal virtual IAnalysisControlInternal CreateNewSandbox(AnalysisOccurrence selected)
		{
			Sandbox sandbox = new Sandbox(selected.Analysis.Cache, m_mediator, m_stylesheet,
				m_lineChoices, selected, this);
			sandbox.SizeToContent = true; // Layout will ignore size.
			//sandbox.Mediator = Mediator;
			sandbox.ShowMorphBundles = true;
			sandbox.StyleSheet = m_stylesheet;
			panelSandbox.Controls.Add(sandbox); // Makes it real and may give it a root box.
			// Note: adding sandbox to Controls doesn't always MakeRoot(), because OnHandleCreated happens
			// only when the parent control is Visible.
			if (sandbox.RootBox == null)
				sandbox.MakeRoot();
			AdjustControlsForRightToLeftWritingSystem(sandbox);
			// this is needed for the Undo button.
			sandbox.SandboxChangedEvent += m_sandbox_SandboxChangedEvent;
			return sandbox as IAnalysisControlInternal;
		}