Exemple #1
0
        public override void SetItem(OverlayItemBase item)
        {
            this.item = (OverlayEventList)item;

            this.ShowFollowsCheckBox.IsChecked    = this.item.ItemTypes.Contains(EventListItemTypeEnum.Followers);
            this.ShowHostsCheckBox.IsChecked      = this.item.ItemTypes.Contains(EventListItemTypeEnum.Hosts);
            this.ShowSubsResubsCheckBox.IsChecked = this.item.ItemTypes.Contains(EventListItemTypeEnum.Subscribers);
            this.ShowDonationsCheckBox.IsChecked  = this.item.ItemTypes.Contains(EventListItemTypeEnum.Donations);
            this.ShowSparksCheckBox.IsChecked     = this.item.ItemTypes.Contains(EventListItemTypeEnum.Sparks);
            this.ShowEmbersCheckBox.IsChecked     = this.item.ItemTypes.Contains(EventListItemTypeEnum.Embers);
            this.ShowMilestonesCheckBox.IsChecked = this.item.ItemTypes.Contains(EventListItemTypeEnum.Milestones);

            this.TotalToShowTextBox.Text       = this.item.TotalToShow.ToString();
            this.ResetOnLoadCheckBox.IsChecked = this.item.ResetOnLoad;

            this.WidthTextBox.Text  = this.item.Width.ToString();
            this.HeightTextBox.Text = this.item.Height.ToString();

            this.TextFontComboBox.Text = this.item.TextFont;

            this.BorderColorComboBox.Text = this.item.BorderColor;
            if (ColorSchemes.HTMLColorSchemeDictionary.ContainsValue(this.item.BorderColor))
            {
                this.BorderColorComboBox.Text = ColorSchemes.HTMLColorSchemeDictionary.FirstOrDefault(c => c.Value.Equals(this.item.BorderColor)).Key;
            }

            this.BackgroundColorComboBox.Text = this.item.BackgroundColor;
            if (ColorSchemes.HTMLColorSchemeDictionary.ContainsValue(this.item.BackgroundColor))
            {
                this.BackgroundColorComboBox.Text = ColorSchemes.HTMLColorSchemeDictionary.FirstOrDefault(c => c.Value.Equals(this.item.BackgroundColor)).Key;
            }

            this.TextColorComboBox.Text = this.item.TextColor;
            if (ColorSchemes.HTMLColorSchemeDictionary.ContainsValue(this.item.TextColor))
            {
                this.TextColorComboBox.Text = ColorSchemes.HTMLColorSchemeDictionary.FirstOrDefault(c => c.Value.Equals(this.item.TextColor)).Key;
            }

            this.AddEventAnimationComboBox.SelectedItem    = EnumHelper.GetEnumName(this.item.AddEventAnimation);
            this.RemoveEventAnimationComboBox.SelectedItem = EnumHelper.GetEnumName(this.item.RemoveEventAnimation);

            this.HTMLText.Text = this.item.HTMLText;
        }
 public OverlayEventListControl(OverlayEventList item)
     : this()
 {
     this.item = item;
 }
#pragma warning disable CS0612 // Type or member is obsolete
        public static OverlayItemModelBase ConvertOverlayItem(OverlayItemBase item)
        {
            if (item is OverlayTextItem)
            {
                OverlayTextItem oItem = (OverlayTextItem)item;
                return(new OverlayTextItemModel(oItem.Text, oItem.Color, oItem.Size, oItem.Font, oItem.Bold, oItem.Italic, oItem.Underline, oItem.ShadowColor));
            }
            else if (item is OverlayImageItem)
            {
                OverlayImageItem oItem = (OverlayImageItem)item;
                return(new OverlayImageItemModel(oItem.FilePath, oItem.Width, oItem.Height));
            }
            else if (item is OverlayVideoItem)
            {
                OverlayVideoItem oItem = (OverlayVideoItem)item;
                return(new OverlayVideoItemModel(oItem.FilePath, oItem.Width, oItem.Height, oItem.Volume));
            }
            else if (item is OverlayYouTubeItem)
            {
                OverlayYouTubeItem oItem = (OverlayYouTubeItem)item;
                return(new OverlayYouTubeItemModel(oItem.VideoID, oItem.Width, oItem.Height, oItem.StartTime, oItem.Volume));
            }
            else if (item is OverlayWebPageItem)
            {
                OverlayWebPageItem oItem = (OverlayWebPageItem)item;
                return(new OverlayWebPageItemModel(oItem.URL, oItem.Width, oItem.Height));
            }
            else if (item is OverlayHTMLItem)
            {
                OverlayHTMLItem oItem = (OverlayHTMLItem)item;
                return(new OverlayHTMLItemModel(oItem.HTMLText));
            }
            else if (item is OverlayChatMessages)
            {
                OverlayChatMessages oItem = (OverlayChatMessages)item;
                return(new OverlayChatMessagesListItemModel(oItem.HTMLText, oItem.TotalToShow, 0, oItem.TextFont, oItem.Width, oItem.TextSize, oItem.BorderColor, oItem.BackgroundColor,
                                                            oItem.TextColor, OverlayListItemAlignmentTypeEnum.Top, (OverlayItemEffectEntranceAnimationTypeEnum)oItem.AddEventAnimation, OverlayItemEffectExitAnimationTypeEnum.None));
            }
            else if (item is OverlayEventList)
            {
                OverlayEventList oItem = (OverlayEventList)item;
                List <OverlayEventListItemTypeEnum> types = new List <OverlayEventListItemTypeEnum>();
                foreach (EventListItemTypeEnum type in oItem.ItemTypes)
                {
                    types.Add((OverlayEventListItemTypeEnum)type);
                }
                return(new OverlayEventListItemModel(oItem.HTMLText, types, oItem.TotalToShow, 0, oItem.TextFont, oItem.Width, oItem.Height, oItem.BorderColor, oItem.BackgroundColor,
                                                     oItem.TextColor, OverlayListItemAlignmentTypeEnum.Top, (OverlayItemEffectEntranceAnimationTypeEnum)oItem.AddEventAnimation, (OverlayItemEffectExitAnimationTypeEnum)oItem.RemoveEventAnimation));
            }
            else if (item is OverlayGameQueue)
            {
                OverlayGameQueue oItem = (OverlayGameQueue)item;
                return(new OverlayGameQueueListItemModel(oItem.HTMLText, oItem.TotalToShow, oItem.TextFont, oItem.Width, oItem.Height, oItem.BorderColor, oItem.BackgroundColor,
                                                         oItem.TextColor, OverlayListItemAlignmentTypeEnum.Top, (OverlayItemEffectEntranceAnimationTypeEnum)oItem.AddEventAnimation, (OverlayItemEffectExitAnimationTypeEnum)oItem.RemoveEventAnimation));
            }
            else if (item is OverlayLeaderboard)
            {
                OverlayLeaderboard oItem = (OverlayLeaderboard)item;
                OverlayLeaderboardListItemModel result = new OverlayLeaderboardListItemModel(oItem.HTMLText, (OverlayLeaderboardListItemTypeEnum)oItem.LeaderboardType, oItem.TotalToShow,
                                                                                             oItem.TextFont, oItem.Width, oItem.Height, oItem.BorderColor, oItem.BackgroundColor, oItem.TextColor, OverlayListItemAlignmentTypeEnum.Top,
                                                                                             (OverlayItemEffectEntranceAnimationTypeEnum)oItem.AddEventAnimation, (OverlayItemEffectExitAnimationTypeEnum)oItem.RemoveEventAnimation, null);
                result.CurrencyID           = oItem.CurrencyID;
                result.LeaderboardDateRange = (OverlayLeaderboardListItemDateRangeEnum)oItem.DateRange;
                return(result);
            }
            else if (item is OverlayProgressBar)
            {
                OverlayProgressBar          oItem  = (OverlayProgressBar)item;
                OverlayProgressBarItemModel result = new OverlayProgressBarItemModel(oItem.HTMLText, (OverlayProgressBarItemTypeEnum)oItem.ProgressBarType, oItem.ResetAfterDays,
                                                                                     oItem.ProgressColor, oItem.BackgroundColor, oItem.TextColor, oItem.TextFont, oItem.Width, oItem.Height, oItem.GoalReachedCommand);
                result.StartAmount         = result.CurrentAmount = oItem.CurrentAmountNumber;
                result.GoalAmount          = oItem.GoalAmountNumber;
                result.CurrentAmountCustom = oItem.CurrentAmountCustom;
                result.GoalAmountCustom    = oItem.GoalAmountCustom;
                return(result);
            }
            else if (item is OverlaySongRequests)
            {
                OverlaySongRequests oItem = (OverlaySongRequests)item;
                return(new OverlaySongRequestsListItemModel(oItem.HTMLText, oItem.TotalToShow, oItem.TextFont, oItem.Width, oItem.Height, oItem.BorderColor, oItem.BackgroundColor,
                                                            oItem.TextColor, true, OverlayListItemAlignmentTypeEnum.Top, (OverlayItemEffectEntranceAnimationTypeEnum)oItem.AddEventAnimation, (OverlayItemEffectExitAnimationTypeEnum)oItem.RemoveEventAnimation));
            }
            else if (item is OverlayStreamBoss)
            {
                OverlayStreamBoss oItem = (OverlayStreamBoss)item;
                return(new OverlayStreamBossItemModel(oItem.HTMLText, oItem.StartingHealth, oItem.Width, oItem.Height, oItem.TextColor, oItem.TextFont, oItem.BorderColor, oItem.BackgroundColor,
                                                      oItem.ProgressColor, oItem.FollowBonus, oItem.HostBonus, oItem.SubscriberBonus, oItem.DonationBonus, oItem.SparkBonus, oItem.EmberBonus, 1.0, 1.0,
                                                      (OverlayItemEffectVisibleAnimationTypeEnum)oItem.DamageAnimation, (OverlayItemEffectVisibleAnimationTypeEnum)oItem.NewBossAnimation, oItem.NewStreamBossCommand));
            }
            else if (item is OverlayMixerClip)
            {
                OverlayMixerClip oItem = (OverlayMixerClip)item;
                return(new OverlayStreamClipItemModel(oItem.Width, oItem.Height, oItem.Volume, (OverlayItemEffectEntranceAnimationTypeEnum)oItem.EntranceAnimation, (OverlayItemEffectExitAnimationTypeEnum)oItem.ExitAnimation));
            }
            else if (item is OverlayTimer)
            {
                OverlayTimer oItem = (OverlayTimer)item;
                return(new OverlayTimerItemModel(oItem.HTMLText, oItem.TotalLength, oItem.TextColor, oItem.TextFont, oItem.TextSize, oItem.TimerCompleteCommand));
            }
            else if (item is OverlayTimerTrain)
            {
                OverlayTimerTrain oItem = (OverlayTimerTrain)item;
                return(new OverlayTimerTrainItemModel(oItem.HTMLText, oItem.MinimumSecondsToShow, oItem.TextColor, oItem.TextFont, oItem.TextSize, oItem.FollowBonus, oItem.HostBonus, oItem.SubscriberBonus, oItem.DonationBonus, oItem.SparkBonus, oItem.EmberBonus));
            }
            return(null);
        }