public bool TryGetAssociatedExpression(Expression e, AssociatedInfo infoKind, out Expression info) { switch (infoKind) { case AssociatedInfo.WritableBytes: return(this.context.ExpressionContext.TryGetWritableBytes(e, out info)); case AssociatedInfo.ArrayLength: return(this.context.ExpressionContext.TryGetArrayLength(e, out info)); default: info = default(Expression); return(false); } }
/// <summary> /// At用户通知 /// </summary> /// <param name="sender">用户名集合</param> /// <param name="eventArgs">事件参数</param> private void AtUserNoticeEventModule_After(IEnumerable <long> sender, AtUserEventArgs eventArgs) { if (sender.Count() == 0) { return; } NoticeService service = new NoticeService(); IUserService userService = DIContainer.Resolve <IUserService>(); User eventArgsUser = userService.GetFullUser(eventArgs.UserId); foreach (var userId in sender) { //关注用户 IUser user = userService.GetUser(userId); if (user == null || user.UserId == eventArgs.UserId) { continue; } IAtUserAssociatedUrlGetter urlGetter = AtUserAssociatedUrlGetterFactory.Get(eventArgs.TenantTypeId); if (urlGetter == null) { continue; } AssociatedInfo ai = urlGetter.GetAssociatedInfo(eventArgs.AssociateId); Notice notice = Notice.New(); notice.TypeId = NoticeTypeIds.Instance().Hint(); notice.UserId = user.UserId; notice.LeadingActorUserId = eventArgs.UserId; notice.LeadingActor = eventArgsUser.DisplayName; notice.LeadingActorUrl = SiteUrls.FullUrl(SiteUrls.Instance().SpaceHome(eventArgs.UserId)); notice.RelativeObjectId = eventArgs.AssociateId; notice.RelativeObjectName = HtmlUtility.TrimHtml(ai.Subject, 12); notice.RelativeObjectUrl = SiteUrls.FullUrl(ai.DetailUrl); notice.Owner = urlGetter.GetOwner(); notice.TemplateName = "AtUser"; service.Create(notice); } }
public bool TryGetAssociatedExpression(APC pc, Expression e, AssociatedInfo infoKind, out Expression info) { Variable var = this.context.ExpressionContext.Unrefine(e); return(TryGetAssociatedExpression(this.context.ExpressionContext.Refine(pc, var), infoKind, out info)); }
public override bool TryGetAssociatedExpression(APC atPC, BoxedExpression e, AssociatedInfo infoKind, out BoxedExpression info) { return(e.TryGetAssociatedInfo(atPC, infoKind, out info)); }
bool IExpressionDecoder <Variable, Expression> .TryGetAssociatedExpression(APC pc, Expression exp, AssociatedInfo infoKind, out Expression info) { throw new System.NotImplementedException(); }
bool IExpressionDecoder <Variable, Expression> .TryGetAssociatedExpression(Expression exp, AssociatedInfo infoKind, out Expression info) { //Contract.Requires(exp != null); throw new System.NotImplementedException(); }