public MpeSkinBrowserDialog(MpeSkinBrowserMode browserMode) { InitializeComponent(); mode = browserMode; preferences = MediaPortalEditor.Global.Preferences; previews = new Hashtable(); if (preferences == null) { throw new Exception("Could not load preferences"); } }
public void LoadHelp() { while (mpe.Preferences == null) { Thread.Sleep(250); } preferences = mpe.Preferences; if (preferences.HelpDir == null || preferences.HelpDir.Exists == false) { MpeLog.Warn("Could not initialize HelpManager!"); return; } rootNode = new TreeNode("Help", 0, 0); LoadHelpFiles(rootNode, preferences.HelpDir); Invoke(new UpdateHelpTreeDelegate(UpdateHelpTree), new object[] { rootNode }); }
public void LoadHelp() { while (mpe.Preferences == null) { Thread.Sleep(250); } preferences = mpe.Preferences; if (preferences.HelpDir == null || preferences.HelpDir.Exists == false) { MpeLog.Warn("Could not initialize HelpManager!"); return; } rootNode = new TreeNode("Help", 0, 0); LoadHelpFiles(rootNode, preferences.HelpDir); Invoke(new UpdateHelpTreeDelegate(UpdateHelpTree), new object[] {rootNode}); }
public MpePreferenceForm() { InitializeComponent(); preferences = MediaPortalEditor.Global.Preferences; }
protected void OnInitEditor(object sender, EventArgs e) { initTimer.Stop(); // Create Preferences try { preferences = new MpePreferences("preferences.xml"); } catch { MessageBox.Show(this, "Invalid preferences file!", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); } // Load Preferences try { LoadPreferences(); } catch (Exception ee) { MpeLog.Debug(ee.Message); } while (preferences.MediaPortalDir == null) { MessageBox.Show(this, "You must set your MediaPortal directory in order to continue.", "MediaPortalEditor", MessageBoxButtons.OK, MessageBoxIcon.Information); MpePreferenceForm form = new MpePreferenceForm(); if (form.ShowDialog(this) == DialogResult.Cancel) { DialogResult r = MessageBox.Show(this, "You must set your MediaPortal directory. Click Retry" + Environment.NewLine + "to select the directory, or Cancel to exit the application.", "Invalid Directory", MessageBoxButtons.RetryCancel, MessageBoxIcon.Warning); if (r == DialogResult.Cancel) { Close(); } else { initTimer.Start(); return; } } } MpeLog.Info("MediaPortal Editor"); Cursor = Cursors.Default; }