本文整理汇总了C#中UserStore.First方法的典型用法代码示例。如果您正苦于以下问题:C# UserStore.First方法的具体用法?C# UserStore.First怎么用?C# UserStore.First使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserStore
的用法示例。
在下文中一共展示了UserStore.First方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public static void Execute (Atom parent){
Task v= new Task( ()=> Firebug.Console.Log("hello"));
v.Start ();
var store = new UserStore ();
var grid = new UserGrid (parent, store);
store.Read ();
var form = new UserForm (parent);
form.ButtonCreate.Disabled = false;
form.ButtonCreate.Clicked+= (e) => {
grid.ClearSelection();
form.Clear();
};
form.ButtonDestroy.Clicked+= (e) => {
form.Clear();
var u = store.First(r=>r.Id== int.Parse( grid.SelectedRow.RecordId ));
store.Remove(u);
};
form.Changed+= (e) => {
form.ButtonSave.Disabled= !form.HasChanges();
};
form.Updated += (fr, ac) => {
form.ButtonDestroy.Disabled= ac == FormUpdatedAction.Clear;
form.ButtonSave.Disabled=true;
};
form.SubmitHandler = fr => SubmitHandler (grid, form, store);
grid.RowSelected += (g, row) => {
var u = store.First(r=>r.Id== int.Parse( row.RecordId));
form.PopulateFrom(u);
};
parent.Append("Paged Tables".Header (3));
var cu = new CustomerStore ();
new CustomerGrid(parent, cu);
parent.Append (new StorePager<Customer>(cu));
cu.Read ();
parent.Append ("Filters".Header (3));
var cu2 = new CustomerStore ();
new TextInput (parent, i=> {
i.Placeholder="Country";
i.On("keyup", evt=>{
var st = i.Value.ToUpper();
cu2.Filter( f=>f.Country.ToUpper().StartsWith(st));
});
});
new CustomerGrid (parent, cu2);
parent.Append (new StorePager<Customer>(cu2));
cu2.Read ();
parent.Append ("C# code".Header(3));
var rq =jQuery.GetData<string> ("code/demotables.html");
rq.Done (s=> {
var code=new Div();
code.InnerHTML= s;
parent.Append(code);
});
}