使用OPENNETCF.Notification建议[收集1]

For all of you who have the same problem here are my suggestions:


  1. Use HTML Tags correctly
  2. only use cmd:0 and cmd:1
  3. don't use uppercase CMD:0
  4. href=cmd:0 or name=cmd:0
  5. register your eventlisteners


to 1) Always use <html><body> your text, links here </body></html>

to 2) cmd:2, cmd:3 ... won't work, also keep in mind to use cmd:0 first. If you have two links you can use cmd:0 and cmd:1

to 3) Uppercase for commands won't work. Always use cmd:0 or cmd:1

to 4) You can use links by specifing "href=cmd:0" or buttons by setting "name=cmd:0". Just don't forget to write an correct <form>-Tag when using buttons (<form><input type=button ...></form>)

to 5) don't forget to register your eventlisters myNotificationEngine.NotificationSelect (*.NotificationDismiss, *.NotificationShow)

Example:
For your Notification.HTML Property you can use:
myNotification.HTML="<html><body><a href=cmd:0>yes</a> <a href=cmd:1>no</a></body></html>";


A whole Example will look like this


<somewhere>
myNotification = new Notification();
myNotification.Duration=10;
myNotification.Title="hallo";
myNotification.Flags=NotificationFlags.ForceMessage;
myNotification.HTML="<html><body><a href=cmd:0>yes</a> <a href=cmd:1>no</a></body></html>";
myNotification.Priority=Priority.Inform;
engine = new NotificationEngine(new System.Guid("your guid here"));
engine.NotificationSelect+=new NotificationEventHandler(engine_NotificationSelect);
engine.Add(myNotification);

<listener>
private void engine_NotificationSelect(object sender, NotificationEventArgs e)
{
	System.Windows.Forms.MessageBox.Show(e.Link.ToString());
}
FROM: http://www.opennetcf.org/forums/topic.asp?TOPIC_ID=2827
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值