Ejemplo n.º 1
0
        /// <summary>
        /// build a XPT Node for a parameter name
        /// </summary>
        /// <param name="ctx"></param>
        /// <returns></returns>
        public bool BuildXPTNode(ParameterNameContext ctx)
        {
            RuleContext root = GetRootContext(ctx, typeof(SelectionRulezContext));

            if (root != null)
            {
                if (((SelectionRulezContext)root).names.ContainsKey(ctx.GetText()))
                {
                    // set the XPTreeNode to the Symbol
                    ctx.XPTreeNode = ((SelectionRule)((SelectionRulezContext)root).XPTreeNode).Parameters.Where(x => x.ID == ctx.GetText()).FirstOrDefault();
                    return(true);
                }
            }
            else
            {
                this.NotifyErrorListeners(String.Format(Messages.RCM_4, ctx.GetText(), "SelectionRule"));
            }
            return(false);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// build a XPT Node for a parameter name
 /// </summary>
 /// <param name="ctx"></param>
 /// <returns></returns>
 public bool BuildXPTNode(ParameterNameContext ctx)
 {
     RuleContext root = GetRootContext(ctx, typeof(SelectionRulezContext));
      if (root != null)
      {
          if (((SelectionRulezContext)root).names.ContainsKey(ctx.GetText()))
          {
              // set the XPTreeNode to the Symbol
              ctx.XPTreeNode = ((SelectionRule)((SelectionRulezContext)root).XPTreeNode).Parameters.Where(x => x.ID == ctx.GetText()).FirstOrDefault();
              return true;
          }
      }else
      this.NotifyErrorListeners(String.Format(Messages.RCM_4, ctx.GetText(), "SelectionRule"));
      return false;
 }