ionic中div可以绑定ng-click 吗
1个回答
展开全部
ionic中div可以绑定ng-click
写一个类,将你要的参数都封装进去。然后通过IAsyncResult.AsyncState进行传递。
// 1)定义类,封装你要的任何东西
class StateObject
{
public Scoekt frd{get;set;}
pubic ComboBox combo{get;set;}
//可以添加任何你需要的东西
//……
}
// 2)在异步调用前,实例化StateObject
StateObject state = new StateObject();
state.frd = frd;
state.combo = comBox_client;
AsyncCallback callBack = new AsyncCallback(sendCallBack);
frd.socket.BeginSend(msg, 0, msg.Length, SocketFlags.None, callBack, state);
//3)在回调函数中使用StateObject
private void sendCallBack(IAsyncResult ar)
{
StateObject state = (StateObject)ar.AsyncState;
//从 state中 取出frd, combo ……
Socket frd = state.frd;
ComboBox combo = state.combo;
try
{
frd.EndSend(ar);
}
catch (System.Exception ex)
{
combo.Invoke(removeFriend, combo, friends,frd)
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询