当前位置: 首页>>代码示例>>C#>>正文


C# MPSettings类代码示例

本文整理汇总了C#中MPSettings的典型用法代码示例。如果您正苦于以下问题:C# MPSettings类的具体用法?C# MPSettings怎么用?C# MPSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MPSettings类属于命名空间,在下文中一共展示了MPSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

    private void Init()
    {
      try
      {
        _deviceClass = HidGuid;
        _doubleClickTime = GetDoubleClickTime();

        _deviceBuffer = new byte[256];

        _deviceWatcher = new DeviceWatcher();
        _deviceWatcher.Create();
        _deviceWatcher.Class = _deviceClass;
        _deviceWatcher.DeviceArrival += new DeviceEventHandler(OnDeviceArrival);
        _deviceWatcher.DeviceRemoval += new DeviceEventHandler(OnDeviceRemoval);
        _deviceWatcher.SettingsChanged += new SettingsChanged(OnSettingsChanged);
        _deviceWatcher.RegisterDeviceArrival();

        // Read if we use Master or Wave volume
        using (Settings reader = new MPSettings())
        {
          isDigital = reader.GetValueAsBool("volume", "digital", false);
        }

        Open();
      }
      catch (Exception e)
      {
        Log.Info("Remote.Init: {0}", e.Message);
      }
    }
开发者ID:cmendozac,项目名称:MediaPortal-1,代码行数:30,代码来源:Remote.cs

示例2: LoadSettings

    public override void LoadSettings()
    {
      if (_init == false)
      {
        return;
      }

      using (Settings xmlreader = new MPSettings())
      {
        cbAllowNormal.Checked = xmlreader.GetValueAsBool("bdplayer", "allowarnormal", true);
        cbAllowOriginal.Checked = xmlreader.GetValueAsBool("bdplayer", "allowaroriginal", true);
        cbAllowZoom.Checked = xmlreader.GetValueAsBool("bdplayer", "allowarzoom", true);
        cbAllowZoom149.Checked = xmlreader.GetValueAsBool("bdplayer", "allowarzoom149", true);
        cbAllowStretch.Checked = xmlreader.GetValueAsBool("bdplayer", "allowarstretch", true);
        cbAllowNonLinearStretch.Checked = xmlreader.GetValueAsBool("bdplayer", "allowarnonlinear", true);
        cbAllowLetterbox.Checked = xmlreader.GetValueAsBool("bdplayer", "allowarletterbox", true);

        //
        // Set default aspect ratio
        //
        string defaultAspectRatio = xmlreader.GetValueAsString("movieplayer", "defaultar",
                                                               defaultZoomModeComboBox.Items[0].ToString());
        foreach (Geometry.Type item in Enum.GetValues(typeof (Geometry.Type)))
        {
          string currentAspectRatio = Util.Utils.GetAspectRatio(item);
          if (defaultAspectRatio == currentAspectRatio)
          {
            defaultZoomModeComboBox.SelectedItem = currentAspectRatio;
            break;
          }
        }
      }
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:33,代码来源:BDZoom.cs

示例3: LoadSettings

    private void LoadSettings()
    {
      using (Profile.Settings xmlreader = new MPSettings())
      {
        // Music
        string playListFolder = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
        playListFolder += @"\My Playlists";
        _musicPlayListFolder = xmlreader.GetValueAsString("music", "playlists", playListFolder);

        if (string.Compare(_musicPlayListFolder, playListFolder) == 0)
        {
          if (Directory.Exists(playListFolder) == false)
          {
            try
            {
              Directory.CreateDirectory(playListFolder);
            }
            catch (Exception) { }
          }
        }
        
        btnMusicrepeatplaylist.Selected = xmlreader.GetValueAsBool("musicfiles", "repeat", false);
        btnMusicautoshuffle.Selected = xmlreader.GetValueAsBool("musicfiles", "autoshuffle", false);
        btnMusicsavecurrentasdefault.Selected = xmlreader.GetValueAsBool("musicfiles", "savePlaylistOnExit", true);
        btnMusicloaddefault.Selected = xmlreader.GetValueAsBool("musicfiles", "resumePlaylistOnMusicEnter", true);
        btnMusicplaylistscreen.Selected= xmlreader.GetValueAsBool("musicfiles", "playlistIsCurrent", true);
        
        // Videos
        _videosPlayListFolder = xmlreader.GetValueAsString("movies", "playlists", playListFolder);
        btnVideosrepeatplaylist.Selected = xmlreader.GetValueAsBool("movies", "repeat", true);
      }
    }
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:32,代码来源:GUISettingsCommon_Playlist.cs

示例4: TvNotifyManager

    public TvNotifyManager()
    {
      using (Settings xmlreader = new MPSettings())
      {
        _enableRecNotification = xmlreader.GetValueAsBool("mytv", "enableRecNotifier", false);
        _preNotifyConfig = xmlreader.GetValueAsInt("mytv", "notifyTVBefore", 300);
      }

      _busy = false;
      _timer = new Timer();
      _timer.Stop();
      // check every 15 seconds for notifies
      _dummyuser = new User();
      _dummyuser.IsAdmin = false;
      _dummyuser.Name = "Free channel checker";
      _timer.Interval = 15000;
      _timer.Enabled = true;
      // Execute TvNotifyManager in a separate thread, so that it doesn't block the Main UI Render thread when Tvservice connection died
      new Thread(() =>
                   {
                     _timer.Tick += new EventHandler(_timer_Tick);

                   }
        ) {Name = "TvNotifyManager"}.Start();
      _notifiedRecordings = new ArrayList();
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:26,代码来源:TvNotifyManager.cs

示例5: VolumeHandler

    public VolumeHandler(int[] volumeTable)
    {
      bool isDigital;

      using (Settings reader = new MPSettings())
      {
        int levelStyle = reader.GetValueAsInt("volume", "startupstyle", 0);

        if (levelStyle == 0)
        {
          _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "lastknown", 52428)));
        }

        if (levelStyle == 1)
        {
        }

        if (levelStyle == 2)
        {
          _startupVolume = Math.Max(0, Math.Min(65535, reader.GetValueAsInt("volume", "startuplevel", 52428)));
        }

        isDigital = reader.GetValueAsBool("volume", "digital", false);

        _showVolumeOSD = reader.GetValueAsBool("volume", "defaultVolumeOSD", true);
      }

      _mixer = new Mixer.Mixer();
      _mixer.Open(0, isDigital);
      _volumeTable = volumeTable;
      _mixer.ControlChanged += mixer_ControlChanged;
    }
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:32,代码来源:VolumeHandler.cs

示例6: LoadSettings

    public override void LoadSettings()
    {
      using (Settings xmlreader = new MPSettings())
      {
        pixelRatioCheckBox.Checked = xmlreader.GetValueAsBool("dvdplayer", "pixelratiocorrection", false);
        aspectRatioComboBox.Text = xmlreader.GetValueAsString("dvdplayer", "armode", "Follow stream");
        displayModeComboBox.Text = xmlreader.GetValueAsString("dvdplayer", "displaymode", "Default");

        //
        // Load all available aspect ratio
        //
        defaultZoomModeComboBox.Items.Clear();
        foreach (Geometry.Type item in Enum.GetValues(typeof (Geometry.Type)))
        {
          defaultZoomModeComboBox.Items.Add(Util.Utils.GetAspectRatio(item));
        }

        //
        // Set default aspect ratio
        //
        string defaultAspectRatio = xmlreader.GetValueAsString("dvdplayer", "defaultar",
                                                               defaultZoomModeComboBox.Items[0].ToString());
        foreach (Geometry.Type item in Enum.GetValues(typeof (Geometry.Type)))
        {
          string currentAspectRatio = Util.Utils.GetAspectRatio(item);
          if (defaultAspectRatio == currentAspectRatio)
          {
            defaultZoomModeComboBox.SelectedItem = currentAspectRatio;
            break;
          }
        }
      }
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:33,代码来源:DVDZoom.cs

示例7: Init

        private void Init()
        {
            using (Settings xmlreader = new MPSettings())
            {
                controlEnabled = xmlreader.GetValueAsBool("remote", "AppCommand", false);
                controlEnabledGlobally = xmlreader.GetValueAsBool("remote", "AppCommandBackground", false);
                logVerbose = xmlreader.GetValueAsBool("remote", "AppCommandVerbose", false);
            }

            if (controlEnabled)
            {
                _inputHandler = new InputHandler("AppCommand");
                if (!_inputHandler.IsLoaded)
                {
                    controlEnabled = false;
                    Log.Info("AppCommand: Error loading default mapping file - please reinstall MediaPortal");
                }
            }

            if (controlEnabledGlobally)
            {
                _keyboardHook = new KeyboardHook();
                _keyboardHook.KeyDown += new KeyEventHandler(OnKeyDown);
                _keyboardHook.IsEnabled = true;
            }
        }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:26,代码来源:AppCommandListener.cs

示例8: SaveSettings

 private void SaveSettings()
 {
   using (Settings xmlreader = new MPSettings())
   {
     xmlreader.SetValue("tvservice", "hostname", _hostName);
   }
 }
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:7,代码来源:TvSetup.cs

示例9: LoadSettings

    public override void LoadSettings()
    {
      using (Settings xmlreader = new MPSettings())
      {
        try
        {
          defaultSubtitleLanguageComboBox.SelectedItem = xmlreader.GetValueAsString("bdplayer", "subtitlelanguage", m_strDefaultSubtitleLanguageISO);
        }
        catch (Exception ex)
        {
          CultureInfo ci = new CultureInfo(m_strDefaultSubtitleLanguageISO);
          Log.Error("LoadSettings - failed to load default subtitle language, using {0} - {1} ", ci.EnglishName, ex);
          defaultSubtitleLanguageComboBox.SelectedItem = ci.EnglishName;
        }
        //Use Internel Menu
        useBDInternalMenu.Checked = xmlreader.GetValueAsBool("bdplayer", "useInternalBDMenu", false);

        try
        {
          defaultAudioLanguageComboBox.SelectedItem=xmlreader.GetValueAsString("bdplayer", "audiolanguage", m_strDefaultAudioLanguageISO);         
        }
        catch (Exception ex)
        {
          CultureInfo ci = new CultureInfo(m_strDefaultAudioLanguageISO);
          Log.Error("LoadSettings - failed to load default audio language, using {0} - {1} ", ci.EnglishName, ex);
          defaultAudioLanguageComboBox.SelectedItem = ci.EnglishName;
        }
      }
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:29,代码来源:BD_global.cs

示例10: LoadSettings

        public override void LoadSettings()
        {
            if (_serialPort != null && _serialPort.IsOpen)
            _serialPort.Close();

              using (Settings reader = new MPSettings())
              {
            DeviceModelName = reader.GetValueAsString("Auto3DPlugin", "OptomaModel", "Default");
            PortName = reader.GetValueAsString("Auto3DPlugin", "OptomaPort", "None");
              }

              if (_serialPort != null)
              {
            _serialPort.PortName = PortName;

            try
            {
              if (_serialPort.PortName != "None")
            _serialPort.Open();
            }
            catch (Exception ex)
            {
              MessageBox.Show(ex.Message, "Auto3D");
              Log.Info("Auto3D: " + ex.Message);
            }
              }
        }
开发者ID:yartat,项目名称:Auto3D,代码行数:27,代码来源:OptomaBeamer.cs

示例11: LoadSettings

 private void LoadSettings()
 {
   using (Settings xmlreader = new MPSettings())
   {
     _hostName = xmlreader.GetValueAsString("tvservice", "hostname", "");
   }
 }
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:7,代码来源:TvSetup.cs

示例12: LoadSettings

    private void LoadSettings()
    {
      // load settings
      using (Settings reader = new MPSettings())
      {
        int hours, minutes;
        hours = reader.GetValueAsInt("musicdbreorg", "hours", 0);
        minutes = reader.GetValueAsInt("musicdbreorg", "minutes", 0);
        VerifySchedule(ref hours, ref minutes);
        hoursTextBox.Text = hours.ToString();
        minutesTextBox.Text = minutes.ToString();
        if (hoursTextBox.Text.Length == 1)
        {
          hoursTextBox.Text = "0" + hoursTextBox.Text;
        }
        if (minutesTextBox.Text.Length == 1)
        {
          minutesTextBox.Text = "0" + minutesTextBox.Text;
        }

        cbMonday.Checked = reader.GetValueAsBool("musicdbreorg", "monday", true);
        cbTuesday.Checked = reader.GetValueAsBool("musicdbreorg", "tuesday", true);
        cbWednesday.Checked = reader.GetValueAsBool("musicdbreorg", "wednesday", true);
        cbThursday.Checked = reader.GetValueAsBool("musicdbreorg", "thursday", true);
        cbFriday.Checked = reader.GetValueAsBool("musicdbreorg", "friday", true);
        cbSaturday.Checked = reader.GetValueAsBool("musicdbreorg", "saturday", true);
        cbSunday.Checked = reader.GetValueAsBool("musicdbreorg", "sunday", true);
      }
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:29,代码来源:MusicDBReorgSettings.cs

示例13: LoadSettings

    public void LoadSettings()
    {
      using (Settings xmlreader = new MPSettings())
      {
        defStyle = new SubtitleStyle();
        defStyle.Load(xmlreader);
        delayInterval = xmlreader.GetValueAsInt("subtitles", "delayInterval", 250);

        bool save = xmlreader.GetValueAsBool("subtitles", "saveNever", true);
        if (save)
        {
          autoSaveType = AutoSaveTypeEnum.NEVER;
        }
        else
        {
          save = xmlreader.GetValueAsBool("subtitles", "saveAsk", false);
          autoSaveType = (save ? AutoSaveTypeEnum.ASK : AutoSaveTypeEnum.ALWAYS);
        }

        posRelativeToFrame = xmlreader.GetValueAsBool("subtitles", "subPosRelative", false);
        overrideASSStyle = xmlreader.GetValueAsBool("subtitles", "subStyleOverride", false);
        subPaths = xmlreader.GetValueAsString("subtitles", "paths", @".\");
        adjustPosY = xmlreader.GetValueAsInt("subtitles", "adjustY", 0);
        autoShow = xmlreader.GetValueAsBool("subtitles", "enabled", true);
        selectionOff = xmlreader.GetValueAsBool("subtitles", "selectionoff", true);
        LoadAdvancedSettings(xmlreader);
      }
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:28,代码来源:SubSettings.cs

示例14: HcwHelper

    private bool restartIRApp = false; // Restart Haupp. IR-app. after MP quit

    /// <summary>
    /// Initialization
    /// </summary>
    public HcwHelper()
    {
      InitializeComponent();

      using (Settings xmlreader = new MPSettings())
      {
        logVerbose = xmlreader.GetValueAsBool("remote", "HCWVerboseLog", false);
        port = xmlreader.GetValueAsInt("remote", "HCWHelperPort", 2110);
        hcwEnabled = xmlreader.GetValueAsBool("remote", "HCW", false);
      }

      connection = new Connection(logVerbose);
      if (hcwEnabled && (GetDllPath() != string.Empty) && connection.Start(port) &&
          irremote.IRSetDllDirectory(GetDllPath()))
      {
        Thread checkThread = new Thread(new ThreadStart(CheckThread));
        checkThread.IsBackground = true;
        checkThread.Priority = ThreadPriority.Highest;
        checkThread.Name = "HcwHelperChecker";
        checkThread.Start();
        connection.ReceiveEvent += new Connection.ReceiveEventHandler(OnReceive);
        StartIR();
      }
      else
      {
        connection.Send(port + 1, "APP", "STOP", DateTime.Now);
        Application.Exit();
      }
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:34,代码来源:HCWHelper.cs

示例15: IsPluginEnabled

 internal static bool IsPluginEnabled(string name)
 {
     using (Settings xmlreader = new MPSettings())
     {
         return xmlreader.GetValueAsBool("plugins", name, false);
     }
 }
开发者ID:ministerkrister,项目名称:Trailers,代码行数:7,代码来源:Utility.cs


注:本文中的MPSettings类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。