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));
            }
        }
 protected abstract TControl CreateControl(
     SingleAnnotationAspectMember <UIControlAttribute> member,
     string label,
     string hint,
     int localeCultureId,
     RestrictionList restrictions,
     InterceptorList interceptors,
     GlobalizationList globalization);
 public BootstrapPresenterControl(
     SingleAnnotationAspectMember<UIControlAttribute> member,
     string label,
     string hint,
     int lcid,
     RestrictionList restrictions,
     InterceptorList interceptors,
     GlobalizationList globalization,
     BootstrapControl control)
     : base(member, label, hint, lcid, restrictions, interceptors, globalization)
 {
     this._Control = control;
 }
示例#4
0
 public HtmlPresenterControl(
     SingleAnnotationAspectMember <UIControlAttribute> member,
     string label,
     string hint,
     int lcid,
     RestrictionList restrictions,
     InterceptorList interceptors,
     GlobalizationList globalization,
     HtmlControl control)
     : base(member, label, hint, lcid, restrictions, interceptors, globalization)
 {
     this._Control = control;
 }
 public UIPresenterControl(
     SingleAnnotationAspectMember <UIControlAttribute> member,
     string label,
     string hint,
     int lcid,
     RestrictionList restrictions,
     InterceptorList interceptors,
     GlobalizationList globalization)
 {
     this._Member         = member;
     this._Groups         = new List <UIControlGroup>(member.GetAttributes <UIControlGroup>(true));
     this._Label          = string.IsNullOrEmpty(label) ? member.Name : label;
     this._Hint           = hint;
     this._LCID           = lcid;
     this._FormatProvider = System.Globalization.CultureInfo.GetCultureInfo(lcid);
     this._Restrictions   = restrictions;
     this._Interceptors   = interceptors;
     this._Globalization  = globalization;
 }
 public UIPresenterControl(
     SingleAnnotationAspectMember<UIControlAttribute> member,
     string label,
     string hint,
     int lcid,
     RestrictionList restrictions,
     InterceptorList interceptors,
     GlobalizationList globalization)
 {
     this._Member = member;
     this._Groups = new List<UIControlGroup>(member.GetAttributes<UIControlGroup>(true));
     this._Label = string.IsNullOrEmpty(label) ? member.Name : label;
     this._Hint = hint;
     this._LCID = lcid;
     this._FormatProvider = System.Globalization.CultureInfo.GetCultureInfo(lcid);
     this._Restrictions = restrictions;
     this._Interceptors = interceptors;
     this._Globalization = globalization;
 }
 public GlobalizationAspectMember(ClassAcessor acessor)
     : base(acessor)
 {
     this._Terms = new GlobalizationList();
 }