public UIPresenter(int localeCultureId) { UIAspect <T> aspect = UIAspect <T> .Instance; GlobalizationAspect <T> globalization = GlobalizationAspect <T> .Instance; RestrictionAspect <T> restrictions = RestrictionAspect <T> .Instance; InterceptorAspect <T> interceptors = InterceptorAspect <T> .Instance; this._Controls = new List <TControl>(aspect.Count); foreach (SingleAnnotationAspectMember <UIControlAttribute> child in aspect) { int globalizationOrdinal = globalization.GetOrdinal(child.Name); GlobalizationList globalizationList = globalizationOrdinal >= 0 ? globalization[globalizationOrdinal].Terms : null; string label = globalizationList == null ? null : globalizationList.GetTerm("label", localeCultureId); string hint = globalizationList == null ? null : globalizationList.GetTerm("hint", localeCultureId); _Controls.Add(CreateControl( child, string.IsNullOrEmpty(label) ? child.Annotation.DefaultLabel : label, string.IsNullOrEmpty(hint) ? child.Annotation.DefaultHint : hint, localeCultureId, restrictions.GetRestrictionList(child.Name), interceptors.GetInterceptorList(child.Name), globalizationList)); } }
public string GetGlobalizationTerm(string termName) { if (_Globalization == null) { return(null); } else { return(_Globalization.GetTerm(termName, _LCID)); } }