Пример #1
0
 public async Task EnableWidget(OverlayWidgetModel widget)
 {
     if (widget != null && !widget.IsEnabled)
     {
         await widget.Enable();
     }
 }
Пример #2
0
 protected override async Task PerformInternal(CommandParametersModel parameters)
 {
     if (this.WidgetID != Guid.Empty)
     {
         OverlayWidgetModel widget = ChannelSession.Settings.OverlayWidgets.FirstOrDefault(w => w.Item.ID.Equals(this.WidgetID));
         if (widget != null)
         {
             if (this.ShowWidget)
             {
                 await widget.Enable(parameters);
             }
             else
             {
                 await widget.Disable();
             }
         }
     }
     else
     {
         string overlayName = (string.IsNullOrEmpty(this.OverlayName)) ? ChannelSession.Services.Overlay.DefaultOverlayName : this.OverlayName;
         IOverlayEndpointService overlay = ChannelSession.Services.Overlay.GetOverlay(overlayName);
         if (overlay != null)
         {
             await overlay.ShowItem(this.OverlayItem, parameters);
         }
     }
 }
Пример #3
0
 protected override async Task PerformInternal(UserViewModel user, IEnumerable <string> arguments)
 {
     if (this.WidgetID != Guid.Empty)
     {
         OverlayWidgetModel widget = ChannelSession.Settings.OverlayWidgets.FirstOrDefault(w => w.Item.ID.Equals(this.WidgetID));
         if (widget != null)
         {
             if (this.ShowWidget)
             {
                 await widget.Enable(user, arguments, this.extraSpecialIdentifiers);
             }
             else
             {
                 await widget.Disable();
             }
         }
     }
     else
     {
         string overlayName = (string.IsNullOrEmpty(this.OverlayName)) ? ChannelSession.Services.Overlay.DefaultOverlayName : this.OverlayName;
         IOverlayEndpointService overlay = ChannelSession.Services.Overlay.GetOverlay(overlayName);
         if (overlay != null)
         {
             await overlay.ShowItem(this.OverlayItem, user, arguments, this.extraSpecialIdentifiers, this.platform);
         }
     }
 }