VB .Net Plugin Development, XML Settings file (1 Viewer)

kyleh0000

MP Donator
  • Premium Supporter
  • April 28, 2009
    144
    23
    Home Country
    Hi All,

    Im looking for a bit of help in developing my plugin, im trying to work out how to implement the XML settings reader (at least i think thats what im after)

    I was reading about this in the developers guide...

    Tips and Tricks

    // Read configuration settings
    using (Settings reader = new Settings(Config.GetFile(Config.Dir.Config, "mediaportal.xml")))
    {
    setting = reader.GetValue("section_name", "setting_name");
    }

    I asume what this does it read the xml config files from and returns the value.

    now i realise the above is not vb .net so i converted it and got this..

    Using reader As New Settings(Config.GetFile(Config.Dir.Config, "mediaportal.xml"))
    setting = reader.GetValue("section_name", "setting_name")
    End Using


    however Visual Studio tells me that Settings is not defined I asume this is because I do not have imported the correct references, however i have spent half a day trying to work out what is missing but so far have gotten no where :(

    I have added core.dll, dialoags.dll and utils.dll as it mentions in the doco, below are my import statements however i have tried every combination of them i can think of so im a bit stumped

    Imports System.Windows.Forms
    Imports System
    Imports MediaPortal.GUI.Library
    Imports MediaPortal.Dialogs
    Imports MediaPortal.Configuration
    Imports MediaPortal.Utils.Web
    Imports MediaPortal.Services

    Any help would be fantastic!
     

    arion_p

    Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,373
    1,626
    Athens
    Home Country
    Greece Greece
    using (Settings reader = new Settings(Config.GetFile(Config.Dir.Config, "mediaportal.xml")))
    This syntax is outdated, use the following instead:
    Code:
      using (Settings reader = new MPSettings())
    You also need to reference Utils.dll and import the MediaPortal.Profile namespace:
    Code:
       Imports MediaPortal.Profile
     

    Users who are viewing this thread

    Top Bottom