private List <CategoryItem> CreateCategories()
        {
            var categories = new List <CategoryItem>();

#pragma warning disable IDE0008 // Use explicit type
            foreach (var t in Enum.GetValues(typeof(DeviceType)))
            {
#pragma warning restore IDE0008

                string       name     = t.ToString();
                CategoryItem category = new CategoryItem()
                {
                    Category = "Devices", Name = name,
                };

                switch (name)
                {
                case nameof(DeviceType.Display):
                    var dui = new DisplaySettings();
                    dui.ItemChanged   += SettingsItemChanged;
                    category.UIElement = dui;
                    break;

                case nameof(DeviceType.InputSwitch):
                    var iui = new InputSwitchSettings();
                    iui.ItemChanged   += SettingsItemChanged;
                    category.UIElement = iui;
                    break;

                case nameof(DeviceType.MediaInfo):
                    var mui = new MediaInfoSettings();
                    mui.ItemChanged   += SettingsItemChanged;
                    category.UIElement = mui;
                    break;

                case nameof(DeviceType.Processor):
                    var pui = new ProcessorSettings();
                    pui.ItemChanged   += SettingsItemChanged;
                    category.UIElement = pui;
                    break;

                case nameof(DeviceType.Serial):
                    var sui = new SerialSettings();
                    sui.ItemChanged   += SettingsItemChanged;
                    category.UIElement = sui;
                    break;

                case nameof(DeviceType.Source):
                    var srui = new SourceSettings();
                    srui.ItemChanged  += SettingsItemChanged;
                    category.UIElement = srui;
                    break;
                }
                categories.Add(category);
            }

            return(categories);
        }
Exemple #2
0
 private void PictureBox_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         MediaInfoSettings settingsForm = new MediaInfoSettings(this);
         settingsForm.ShowDialog();
         //MessageBox.Show("Hi, there this is my contribution for Tango DJ", "Programed by AlexB");
     }
 }
Exemple #3
0
        private static void LoadMediaInfoSettings()
        {
            try
            {
                string path = FileSystemPaths.PathSettings + "MediaInfo.txt";

                if (!File.Exists(path))
                {
                    return;
                }

                string json = IO.ReadTextFromFile(path);

                mediaInfo = JsonConvert.DeserializeObject(json, typeof(MediaInfoSettings)) as MediaInfoSettings;
            }
            catch (Exception exception)
            {
                XtraMessageBox.Show("Failed to load LookAndFeel settings. Please check log for more info.");
                Log.WriteToLog(LogSeverity.Error, 0, exception.Message, exception.StackTrace);
            }
        }
Exemple #4
0
        double snhl;                           // = .25;    //Horisontal Location multiplyer Song Numbers
        #endregion



        public MainForm()
        {
            InitializeComponent();

            // instantiate the delegate and register a method with the new instance.
            NewSongDel newSong = new NewSongDel(onNewSongStarted);

            sDB         = new SDBApplicationClass();
            sDB.OnPlay += newSong.Invoke;   //OnPlay event from MediaMonkey API

            Reader reader = new Reader();

            orqs = reader.ReadIni();

            //Get UI from Settings Form
            if (mi == null)
            {
                mi = new MediaInfoSettings();
            }
            ui = mi.ui;

            GetStarted();
        }
Exemple #5
0
        private static void LoadMediaInfoSettings()
        {
            try
            {
                string path = FileSystemPaths.PathSettings + "MediaInfo.txt";

                if (!File.Exists(path))
                {
                    return;
                }

                string json = IO.ReadTextFromFile(path);

                mediaInfo = JsonConvert.DeserializeObject(json, typeof(MediaInfoSettings)) as MediaInfoSettings;
            }
            catch (Exception exception)
            {
                XtraMessageBox.Show("Failed to load LookAndFeel settings. Please check log for more info.");
                Log.WriteToLog(LogSeverity.Error, 0, exception.Message, exception.StackTrace);
            }
        }