private void GetSign() { _sign.Name = SignName; _sign.Sign = SignItem; _sign.Message = LiveMessage; _sign.ButtonGraphic = chkButtonGraphic.Checked; List <QueueControlType> lstQueueCtlType = new List <QueueControlType>(); for (int i = 0; i < chkQueueControl.Items.Count; i++) { if (chkQueueControl.Items[i].CheckState == CheckState.Checked) { QueueControlType queueCtlType = (QueueControlType)Enum.Parse(typeof(QueueControlType), chkQueueControl.Items[i].Value.ToString(), true); lstQueueCtlType.Add(queueCtlType); } } _sign.QueueControl = lstQueueCtlType.ToArray(); if (rdoMediaControl.SelectedIndex >= 0) { string mediaType = rdoMediaControl.Properties.Items[rdoMediaControl.SelectedIndex].Value.ToString(); MediaControlType mediaCtlType = (MediaControlType)Enum.Parse(typeof(MediaControlType), mediaType, true); _sign.MediaControl = mediaCtlType; } }
public void MediaControl(MediaControlType controlType) { switch (controlType) { case MediaControlType.Play: mediaElement.Play(); break; case MediaControlType.Pause: mediaElement.Pause(); break; case MediaControlType.Stop: mediaElement.Stop(); break; } }
private void Init() { _sign.CreateTime = DateTime.Now; _sign.Id = Guid.NewGuid().ToString(); string[] queueCtlType = Enum.GetNames(typeof(QueueControlType)); string[] mediaCtlType = Enum.GetNames(typeof(MediaControlType)); foreach (string str in mediaCtlType) { MediaControlType type = (MediaControlType)Enum.Parse(typeof(MediaControlType), str, true); switch (type) { case MediaControlType.PlayNext: this.rdoMediaControl.Properties.Items.Add(new DevExpress.XtraEditors.Controls.RadioGroupItem(str, "Play Next")); break; case MediaControlType.PlayNormal: this.rdoMediaControl.Properties.Items.Add(new DevExpress.XtraEditors.Controls.RadioGroupItem(str, "Play Normal")); break; case MediaControlType.PlayNow: this.rdoMediaControl.Properties.Items.Add(new DevExpress.XtraEditors.Controls.RadioGroupItem(str, "Play Now")); break; case MediaControlType.SendToAutoQueue: this.rdoMediaControl.Properties.Items.Add(new DevExpress.XtraEditors.Controls.RadioGroupItem(str, "Send To Auto-Queue")); break; } } foreach (string str in queueCtlType) { QueueControlType type = (QueueControlType)Enum.Parse(typeof(QueueControlType), str, true); switch (type) { case QueueControlType.AutoQueueOff: chkQueueControl.Items.Add(str, "Auto-Queue Off"); break; case QueueControlType.AutoQueueOn: chkQueueControl.Items.Add(str, "Auto-Queue On"); break; case QueueControlType.ClearAll: chkQueueControl.Items.Add(str, "Clear All"); break; case QueueControlType.ClearQueue: chkQueueControl.Items.Add(str, "Clear Queue"); break; case QueueControlType.EjectMessage: chkQueueControl.Items.Add(str, "Eject Message"); break; case QueueControlType.Pause: chkQueueControl.Items.Add(str, "Pause"); break; case QueueControlType.Resume: chkQueueControl.Items.Add(str, "Resume"); break; } } }