Пример #1
0
        /// <summary>
        /// Opens the lexical rule editor dialog for the selected rule.
        /// </summary>
        /// <param name="sender">
        /// A <see cref="System.Object"/>
        /// </param>
        /// <param name="args">
        /// A <see cref="EventArgs"/>
        /// </param>
        private void OnEditBtnClicked(object sender, EventArgs args)
        {
            TreeIter selected;

            rulesTV.Selection.GetSelected(out selected);

            LexicalRule rule = rulesStore.GetValue(selected, 2) as LexicalRule;

            LexicalRuleEditorDialog dialog =
                new LexicalRuleEditorDialog(lexicalRulesManagerDialog);

            dialog.Rule = rule;

            ResponseType res = dialog.Show();

            if (res == ResponseType.Ok)
            {
                // The modified rule.
                rule = dialog.Rule;
                rulesStore.SetValue(selected, 0, rule.Name);
                rulesStore.SetValue(selected,
                                    1,
                                    String.Join(" | ",
                                                rule.LexicalExpressions.ToArray()));
                rulesStore.SetValue(selected, 2, rule);
            }

            dialog.Destroy();
        }
Пример #2
0
        /// <summary>
        /// Opens the new rule dialog, and adds the rule if that dialog response
        /// is ok.
        /// </summary>
        /// <param name="sender">
        /// A <see cref="System.Object"/>
        /// </param>
        /// <param name="args">
        /// A <see cref="EventArgs"/>
        /// </param>
        private void OnAddBtnClicked(object sender, EventArgs args)
        {
            LexicalRuleEditorDialog dialog =
                new LexicalRuleEditorDialog(lexicalRulesManagerDialog);

            ResponseType res = dialog.Show();

            if (res == ResponseType.Ok)
            {
                AddRule(dialog.Rule);
            }

            dialog.Destroy();
        }
		/// <summary>
		/// Opens the lexical rule editor dialog for the selected rule.
		/// </summary>
		/// <param name="sender">
		/// A <see cref="System.Object"/>
		/// </param>
		/// <param name="args">
		/// A <see cref="EventArgs"/>
		/// </param>
		private void OnEditBtnClicked(object sender, EventArgs args)
		{
			TreeIter selected;
			rulesTV.Selection.GetSelected(out selected);
			
			LexicalRule rule = rulesStore.GetValue(selected, 2) as LexicalRule;
			
			LexicalRuleEditorDialog dialog = 
				new LexicalRuleEditorDialog(lexicalRulesManagerDialog);
			
			dialog.Rule = rule;
			
			ResponseType res = dialog.Show();
			
			if(res == ResponseType.Ok)
			{
				// The modified rule.
				rule = dialog.Rule;
				rulesStore.SetValue(selected,0,rule.Name);
				rulesStore.SetValue(selected,
				                    1,
				            	   	String.Join(" | ", 
				                                rule.LexicalExpressions.ToArray()));
				rulesStore.SetValue(selected, 2,rule);
			}
			
			dialog.Destroy();
		}
		/// <summary>
		/// Opens the new rule dialog, and adds the rule if that dialog response
		/// is ok.
		/// </summary>
		/// <param name="sender">
		/// A <see cref="System.Object"/>
		/// </param>
		/// <param name="args">
		/// A <see cref="EventArgs"/>
		/// </param>
		private void OnAddBtnClicked(object sender, EventArgs args)
		{
			
			LexicalRuleEditorDialog dialog = 
				new LexicalRuleEditorDialog(lexicalRulesManagerDialog);
			
			ResponseType res = dialog.Show();
			
			if(res == ResponseType.Ok)
			{
				AddRule(dialog.Rule);				
			}
			
			dialog.Destroy();
			
		}