예제 #1
0
        public async Task ShowItem(OverlayItemModelBase item, UserViewModel user, IEnumerable <string> arguments, Dictionary <string, string> extraSpecialIdentifiers)
        {
            if (item != null)
            {
                try
                {
                    JObject jobj = await item.GetProcessedItem(user, arguments, extraSpecialIdentifiers);

                    if (jobj != null)
                    {
                        if (item is OverlayImageItemModel || item is OverlayVideoItemModel)
                        {
                            OverlayFileItemModelBase fileItem = (OverlayFileItemModelBase)item;
                            string filePath = jobj["FilePath"].ToString();
                            this.SetLocalFile(fileItem.FileID, filePath);
                            jobj["FullLink"] = fileItem.GetFileFullLink(fileItem.FileID, fileItem.FileType, filePath);
                        }
                        else if (item is OverlaySparkCrystalItemModel)
                        {
                            OverlaySparkCrystalItemModel sparkCrystalItem = (OverlaySparkCrystalItemModel)item;
                            if (!string.IsNullOrEmpty(sparkCrystalItem.CustomImageFilePath))
                            {
                                this.SetLocalFile(sparkCrystalItem.ID.ToString(), jobj["CustomImageFilePath"].ToString());
                            }
                        }
                        await this.SendPacket("Show", jobj);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Log(ex);
                }
            }
        }
예제 #2
0
        public async Task UpdateItem(OverlayItemModelBase item, UserViewModel user, IEnumerable <string> arguments, Dictionary <string, string> extraSpecialIdentifiers, StreamingPlatformTypeEnum platform)
        {
            if (item != null)
            {
                try
                {
                    JObject jobj = await item.GetProcessedItem(user, arguments, extraSpecialIdentifiers, platform);

                    if (jobj != null)
                    {
                        await this.SendPacket("Update", jobj);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Log(ex);
                }
            }
        }
        public async Task UpdateItem(OverlayItemModelBase item, CommandParametersModel parameters)
        {
            if (item != null)
            {
                try
                {
                    JObject jobj = await item.GetProcessedItem(parameters);

                    if (jobj != null)
                    {
                        await this.SendPacket("Update", jobj);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Log(ex);
                }
            }
        }
예제 #4
0
        public async Task UpdateItem(OverlayItemModelBase item, CommandParametersModel parameters)
        {
            if (item != null)
            {
                try
                {
                    JObject jobj = await item.GetProcessedItem(parameters);

                    if (jobj != null)
                    {
                        if (item is OverlayImageItemModel || item is OverlayVideoItemModel || item is OverlaySoundItemModel)
                        {
                            this.SetLocalFile(jobj["FileID"].ToString(), jobj["FilePath"].ToString());
                            jobj["FullLink"] = OverlayItemModelBase.GetFileFullLink(jobj["FileID"].ToString(), jobj["FileType"].ToString(), jobj["FilePath"].ToString());
                        }
                        await this.SendPacket("Update", jobj);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Log(ex);
                }
            }
        }
예제 #5
0
        public async Task ShowItem(OverlayItemModelBase item, UserViewModel user, IEnumerable <string> arguments, Dictionary <string, string> extraSpecialIdentifiers, StreamingPlatformTypeEnum platform)
        {
            if (item != null)
            {
                try
                {
                    JObject jobj = await item.GetProcessedItem(user, arguments, extraSpecialIdentifiers, platform);

                    if (jobj != null)
                    {
                        if (item is OverlayImageItemModel || item is OverlayVideoItemModel || item is OverlaySoundItemModel)
                        {
                            this.SetLocalFile(jobj["FileID"].ToString(), jobj["FilePath"].ToString());
                            jobj["FullLink"] = OverlayItemModelBase.GetFileFullLink(jobj["FileID"].ToString(), jobj["FileType"].ToString(), jobj["FilePath"].ToString());
                        }
                        await this.SendPacket("Show", jobj);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Log(ex);
                }
            }
        }