.NET 學習

.NET 學習生活感想... 万事成蹉跎..... 贵在坚持 及时整理自己做过和学过的东西

博客园 首页 新随笔 联系 订阅 管理
代码
using System;
using System.Collections.Generic;
using System.Text;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.SystemModule;
using DevExpress.ExpressApp.Actions;

namespace Solution1.Module {
    
public class FilterControllerExtender : Controller {
        
protected override void OnFrameAssigned() {
            
base.OnFrameAssigned();
            Frame.GetController
<FilterController>().FullTextFilterAction.Executed += new EventHandler<DevExpress.ExpressApp.Actions.ActionBaseEventArgs>(FullTextFilterAction_Executed);
            Frame.GetController
<FilterController>().Activated += new EventHandler(FilterControllerExtender_Activated);
        }

        
void FilterControllerExtender_Activated(object sender, EventArgs e) {
            
string currentValue = Frame.GetController<FilterController>().FullTextFilterAction.Value as string;
            Frame.GetController
<FilterController>().FullTextFilterAction.DoExecute(
                Frame.View.Info.GetAttributeValue(
"FilterByText_CurrentFilter", currentValue));
        }

        
void FullTextFilterAction_Executed(object sender, DevExpress.ExpressApp.Actions.ActionBaseEventArgs e) {
            
string currentValue = ((ParametrizedAction)e.Action).Value as string;
            
if(Frame.View != null) {
                Frame.View.Info.SetAttribute(
"FilterByText_CurrentFilter", currentValue);
            }
        }
    }
}

 

posted on 2009-12-16 09:17  Tonyyang  阅读(592)  评论(0编辑  收藏  举报
欢迎转载,转载请注明出处:http://www.cnblogs.com/Tonyyang/