Ejemplo n.º 1
0
 public static void RaisePopupMenuShowingX(this IXpandFilterControl filterControl, PopupMenuShowingEventArgs e)
 {
     if (e.MenuType == FilterControlMenuType.Clause && filterControl.ModelMembers != null)
     {
         var criteriaOperator = new XpandNodeToCriteriaProcessor().Process(e.CurrentNode);
         var operandProperty  = criteriaOperator.GetOperators().OfType <OperandProperty>().First();
         var modelMember      = filterControl.ModelMembers.Cast <IModelMemberFullTextContains>().FirstOrDefault(member => member.FullText && member.Name == operandProperty.PropertyName);
         if (modelMember != null)
         {
             var dxMenuItem = new DXMenuItem(ClauseTypeEnumHelper.GetMenuStringByClauseType(ClauseTypeEnumHelper.FullText), filterControl.OnClauseClick)
             {
                 Tag = ClauseTypeEnumHelper.FullText
             };
             e.Menu.Items.Add(dxMenuItem);
         }
     }
 }
Ejemplo n.º 2
0
 public override string GetMenuStringByType(ClauseType type)
 {
     return(Enum.IsDefined(typeof(ClauseType), type) ? base.GetMenuStringByType(type) :
            ClauseTypeEnumHelper.GetMenuStringByClauseType((int)type));
 }