コード例 #1
0
 /// <summary>
 /// Set a widget to an item
 /// </summary>
 public void SetWidget(DashboardWidget widget)
 {
     _widget    = widget;
     WidgetGUID = _widget.GUID;
     if (string.IsNullOrEmpty(Name))
     {
         Name = _widget.Name;
     }
     if (string.IsNullOrEmpty(Icon))
     {
         Icon = _widget.Icon;
     }
     if (string.IsNullOrEmpty(Color))
     {
         Color = _widget.Color;
     }
     if (Width == -1)
     {
         Width = _widget.Width;
     }
     if (Height == -1)
     {
         Height = _widget.Height;
     }
     if (Dynamic == null)
     {
         Dynamic = _widget.Dynamic;
     }
     if (Refresh == -2)
     {
         Refresh = _widget.Refresh;
     }
 }
コード例 #2
0
ファイル: SecurityUser.cs プロジェクト: zyhhb/Seal-Report
 /// <summary>
 /// True if the widget can be selected
 /// </summary>
 public bool CanSelectWidget(DashboardWidget item)
 {
     return(!ForbiddenWidgets.Exists(i =>
                                     (string.IsNullOrEmpty(i.ReportName) || i.ReportName == item.ReportName) &&
                                     (string.IsNullOrEmpty(i.Tag) || i.Tag == item.Tag) &&
                                     (string.IsNullOrEmpty(i.Name) || i.Name == item.Name)
                                     ));
 }