SIL.FieldWorks.Common.Framework.DetailControls.StTextSlice.OnAddToLexicon C# (CSharp) Method

OnAddToLexicon() public method

public OnAddToLexicon ( object argument ) : bool
argument object
return bool
		public bool OnAddToLexicon(object argument)
		{
			CheckDisposed();

			int ichMin;
			int ichLim;
			int hvo;
			int tag;
			int ws;
			ITsString tss;
			GetWordLimitsOfSelection(out ichMin, out ichLim, out hvo, out tag, out ws, out tss);
			if (ws == 0)
				ws = GetWsFromString(tss, ichMin, ichLim);
			if (ichLim > ichMin && ws == m_cache.DefaultVernWs)
			{
				ITsStrBldr tsb = tss.GetBldr();
				if (ichLim < tsb.Length)
					tsb.Replace(ichLim, tsb.Length, null, null);
				if (ichMin > 0)
					tsb.Replace(0, ichMin, null, null);
				ITsString tssForm = tsb.GetString();
				using (var dlg = new InsertEntryDlg())
				{
					dlg.SetDlgInfo(m_cache, tssForm, m_mediator);
					if (dlg.ShowDialog(this) == DialogResult.OK)
					{
						// is there anything special we want to do?
					}
				}
				return true;
			}
			return false;
		}