/// <summary> /// Creates a widget based on the type of the item pased. /// </summary> /// <param name="item"> /// The <see cref="ExpressionItem"/> that will be contained in the /// widget. /// </param> /// <param name="container"> /// The container holding the new widget. /// </param> /// <returns> /// The widget holding the given item. /// </returns> public static ExpressionItemWidget CreateWidget(ExpressionItem item, IExpressionItemContainer container) { ExpressionItemWidget widget = null; if (item.GetType() == typeof(ExpressionGroupItem)) { widget = new ExpressionGroupWidget(container); } else if (item.GetType() == typeof(ExpressionTokenItem)) { widget = new ExpressionTokenWidget(container); } if (item.GetType() == typeof(ExpressionRuleCallItem)) { widget = new ExpressionRuleCallWidget(container); } widget.ExpressionItem = item; return(widget); }
/// <summary> /// Creates a widget based on the type of the item pased. /// </summary> /// <param name="item"> /// The <see cref="ExpressionItem"/> that will be contained in the /// widget. /// </param> /// <param name="container"> /// The container holding the new widget. /// </param> /// <returns> /// The widget holding the given item. /// </returns> public static ExpressionItemWidget CreateWidget(ExpressionItem item, IExpressionItemContainer container) { ExpressionItemWidget widget = null; if(item.GetType() == typeof(ExpressionGroupItem)) { widget= new ExpressionGroupWidget(container); } else if(item.GetType() == typeof(ExpressionTokenItem)) { widget = new ExpressionTokenWidget(container); } if(item.GetType() == typeof(ExpressionRuleCallItem)) { widget = new ExpressionRuleCallWidget(container); } widget.ExpressionItem = item; return widget; }