/// <summary>
        /// Sets the alpha variables on the currently selected natural class simple context.
        /// </summary>
        public void SetContextVariables()
        {
            var  sel         = SelectionHelper.Create(m_view);
            bool reconstruct = false;

            UndoableUnitOfWorkHelper.Do(MEStrings.ksRegRuleUndoSetVariables, MEStrings.ksRegRuleRedoSetVariables, RHS, () =>
            {
                using (var featChooser = new FeatureConstraintChooserDlg())
                {
                    var ctxt = CurrentContext as IPhSimpleContextNC;
                    featChooser.SetDlgInfo(m_cache, Mediator, RHS.OwningRule, ctxt);
                    DialogResult res = featChooser.ShowDialog();
                    if (res != DialogResult.Cancel)
                    {
                        featChooser.HandleJump();
                    }
                    reconstruct = res == DialogResult.OK;
                }
            });

            m_view.Select();
            if (reconstruct)
            {
                m_view.RootBox.Reconstruct();
                sel.RestoreSelectionAndScrollPos();
            }
        }
예제 #2
0
        /// <summary>
        /// Sets the alpha variables on the currently selected natural class simple context.
        /// </summary>
        public void SetContextVariables()
        {
            SelectionHelper sel         = SelectionHelper.Create(m_view);
            bool            reconstruct = false;

            using (new UndoRedoTaskHelper(m_cache, MEStrings.ksRegRuleUndoSetVariables, MEStrings.ksRegRuleRedoSetVariables))
            {
                using (FeatureConstraintChooserDlg featChooser = new FeatureConstraintChooserDlg())
                {
                    IPhSimpleContextNC ctxt = new PhSimpleContextNC(m_cache, CurrentContextHvo);
                    featChooser.SetDlgInfo(m_cache, Mediator, new PhRegularRule(m_cache, RHS.OwnerHVO), ctxt);
                    DialogResult res = featChooser.ShowDialog();
                    if (res != DialogResult.Cancel)
                    {
                        featChooser.HandleJump();
                    }
                    reconstruct = res == DialogResult.OK;
                }
            }

            m_view.Select();
            if (reconstruct)
            {
                m_view.RootBox.Reconstruct();
                sel.RestoreSelectionAndScrollPos();
            }
        }
예제 #3
0
		/// <summary>
		/// Sets the alpha variables on the currently selected natural class simple context.
		/// </summary>
		public void SetContextVariables()
		{
			SelectionHelper sel = SelectionHelper.Create(m_view);
			bool reconstruct = false;
			using (new UndoRedoTaskHelper(m_cache, MEStrings.ksRegRuleUndoSetVariables, MEStrings.ksRegRuleRedoSetVariables))
			{
				using (FeatureConstraintChooserDlg featChooser = new FeatureConstraintChooserDlg())
				{
					IPhSimpleContextNC ctxt = new PhSimpleContextNC(m_cache, CurrentContextHvo);
					featChooser.SetDlgInfo(m_cache, Mediator, new PhRegularRule(m_cache, RHS.OwnerHVO), ctxt);
					DialogResult res = featChooser.ShowDialog();
					if (res != DialogResult.Cancel)
						featChooser.HandleJump();
					reconstruct = res == DialogResult.OK;
				}
			}

			m_view.Select();
			if (reconstruct)
			{
				m_view.RootBox.Reconstruct();
				sel.RestoreSelectionAndScrollPos();
			}
		}