Example #1
0
 /// <summary>
 /// Add widget before the specified widget<br/>
 /// If specified widget not found then add it to the front<br/>
 /// 在指定模块前插入模块<br/>
 /// 如果指定模块不存在则插入到开头<br/>
 /// </summary>
 /// <param name="widgets">Widgets</param>
 /// <param name="beforePath">Add before widget that path equals it</param>
 /// <param name="path">Widget path, must without extension</param>
 /// <param name="args">Arguments</param>
 public static void AddBefore(
     this IList <TemplateWidget> widgets, string beforePath, string path, object args = null)
 {
     widgets.AddBefore(x => x.Path == beforePath, new TemplateWidget(path, args));
 }
Example #2
0
 /// <summary>
 /// 移动列到指定的列前面
 /// </summary>
 /// <param name="columns">列列表</param>
 /// <param name="column">需要移动的列</param>
 /// <param name="key">指定的列的识别键</param>
 public static void MoveBefore(
     this IList <AjaxTableColumn> columns, AjaxTableColumn column, string key)
 {
     columns.Remove(column);
     columns.AddBefore(c => c.Key == key, column);
 }