@通知用户

这是上星期写的@用户类,素颜代码,还没有美化,将就这看吧,今天看到@红薯写的OSCHINA通知用户代码开源了,我也贡献一点点代码…略表心意… 代码的用法: 一般情况下直接实例化; public void TestAtUser(){ string UserID = "";//当前使用用户ID //我是为了以后降低效率用的,前台javascript把需要@用户放在json数组里面传递过来;当前项目用的是遍历所有用户,然后匹配出@用户 string JsonUser = "{user:[{username:"",userid:""}]}"; //通知用户的列表 string CallbackString; AtUser notificationatuser = new AtUser(); notificationatuser.AtUserMatch(UserID, strStatus, JsonUser, out CallbackString); //用For循环出用户列表 notificationatuser.AtUserNotification(UserID,Href) } 考虑到如果@用户非常多,效率会降低,而通知不一定要实时的,所以我在项目中用委托的方式; 委托方式加上这些代码 private delegate void DelegateAtUser(AtUser at, string UserID, string Href); DelegateAtUser delegateatuser = new DelegateAtUser(NotificationAtUser); delegateatuser.BeginInvoke(at, UserID, string.Format("/Space/Posts/{0}", intStatusID), null, null); <无> .CodeEntity .code_pieces ul.piece_anchor{width:25px;position:absolute;top:25px;left:-30px;z-index:1000;}.CodeEntity .code_pieces ul.piece_anchor li{width:25px;background: #efe;margin-bottom:2px;}.CodeEntity .code_pieces ul.piece_anchor li{border-left:3px #40AA63 solid;border-right:3px #efe solid;}.CodeEntity .code_pieces ul.piece_anchor li:hover{border-right:3px #40AA63 solid;border-left:3px #efe solid;}.CodeEntity .code_pieces ul.piece_anchor li a{color: #333;padding: 3px 10px;}.CodeEntity .code_pieces .jump_to_code{visibility:hidden;position:relative;}.CodeEntity .code_pieces .code_piece:hover .jump_to_code{visibility:visible;}.CodeEntity .code_pieces .code_piece:hover .jump_to_code a{text-decoration:none;}.CodeEntity .code_pieces h2 i{float:right;font-style:normal;font-weight:normal;}.CodeEntity .code_pieces h2 i a{font-size:9pt;background: #FFFFFF;color:#00A;padding: 2px 5px;text-decoration:none;}

@通知用户

相关文章:

你感兴趣的文章:

标签云: