11using Util . Ui . Angular . Configs ;
22using Util . Ui . Configs ;
33
4- namespace Util . Ui . Angular . Extensions ;
4+ namespace Util . Ui . Angular . Extensions ;
55
66/// <summary>
77/// 配置扩展
@@ -13,13 +13,30 @@ public static class ConfigExtensions {
1313 /// <param name="config">配置</param>
1414 public static Config CopyRemoveAttributes ( this Config config ) {
1515 var result = config . Copy ( ) ;
16- result . RemoveAttribute ( UiConst . Id ) ;
17- result . RemoveAttribute ( AngularConst . RawId ) ;
18- result . RemoveAttribute ( UiConst . Name ) ;
19- result . RemoveAttribute ( AngularConst . BindName ) ;
20- result . RemoveAttribute ( UiConst . Style ) ;
21- result . RemoveAttribute ( UiConst . Class ) ;
2216 result . OutputAttributes . Clear ( ) ;
17+ result . AllAttributes . Clear ( ) ;
18+ LoadConfig ( config , result , UiConst . Required ) ;
19+ LoadConfig ( config , result , UiConst . RequiredMessage ) ;
20+ LoadConfig ( config , result , UiConst . Suffix ) ;
21+ LoadConfig ( config , result , AngularConst . BindSuffix ) ;
22+ LoadConfig ( config , result , UiConst . Extra ) ;
23+ LoadConfig ( config , result , AngularConst . BindExtra ) ;
24+ LoadConfig ( config , result , UiConst . ErrorTip ) ;
25+ LoadConfig ( config , result , AngularConst . BindErrorTip ) ;
26+ LoadConfig ( config , result , UiConst . SuccessTip ) ;
27+ LoadConfig ( config , result , AngularConst . BindSuccessTip ) ;
28+ LoadConfig ( config , result , UiConst . ValidatingTip ) ;
29+ LoadConfig ( config , result , AngularConst . BindValidatingTip ) ;
30+ LoadConfig ( config , result , UiConst . WarningTip ) ;
31+ LoadConfig ( config , result , AngularConst . BindWarningTip ) ;
2332 return result ;
2433 }
34+
35+ /// <summary>
36+ /// 加载配置
37+ /// </summary>
38+ private static void LoadConfig ( Config from , Config to , string name ) {
39+ var value = from . GetValue ( name ) ;
40+ to . SetAttribute ( name , value ) ;
41+ }
2542}
0 commit comments