/// <summary> /// Runs the main logic of the activity. Has access to the context, /// which holds the values of properties for this activity and those from the parent scope. /// </summary> /// <param name="context"></param> /// <param name="cancellationToken"></param> /// <returns></returns> protected override async Task <Action <AsyncCodeActivityContext> > ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken) { //var property = context.DataContext.GetProperties()[ParentScope.ApplicationTag]; //var app = property.GetValue(context.DataContext) as Application; if (ShowBalloonMessage.Get(context) == true) { System.Windows.Forms.NotifyIcon notifyIcon1 = new System.Windows.Forms.NotifyIcon(); notifyIcon1.Icon = SystemIcons.Exclamation; notifyIcon1.BalloonTipTitle = Title.Get(context); notifyIcon1.BalloonTipText = Message.Get(context); notifyIcon1.BalloonTipIcon = IconType.Get(context); notifyIcon1.Visible = true; notifyIcon1.ShowBalloonTip(Timeout.Get(context)); } return(ctx => { Success.Set(ctx, true); }); }