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


C# Settings.GetValueAsString方法代码示例

本文整理汇总了C#中Settings.GetValueAsString方法的典型用法代码示例。如果您正苦于以下问题:C# Settings.GetValueAsString方法的具体用法?C# Settings.GetValueAsString怎么用?C# Settings.GetValueAsString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Settings的用法示例。


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

示例1: EventGhostPlus

        public EventGhostPlus()
        {
            SystemStandby = false;
            Sending = false;
            using (Settings xmlReader = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
            {
                egPath = xmlReader.GetValueAsString(PLUGIN_NAME, "egPath", "");
                egPart2 = xmlReader.GetValueAsString(PLUGIN_NAME, "egPart2", "Type");
                egPart3 = xmlReader.GetValueAsString(PLUGIN_NAME, "egPart3", "Status");
                egPayload = xmlReader.GetValueAsBool(PLUGIN_NAME, "egPayload", false);
                WindowChange = xmlReader.GetValueAsBool(PLUGIN_NAME, "WindowChange", false);

                isTcpip = xmlReader.GetValueAsBool(PLUGIN_NAME, "tcpipIsEnabled", false);
                Host = xmlReader.GetValueAsString(PLUGIN_NAME, "tcpipHost", "");
                Port = xmlReader.GetValueAsString(PLUGIN_NAME, "tcpipPort", "");
                Password = xmlReader.GetValueAsString(PLUGIN_NAME, "tcpipPassword", "");
                PWDEncrypted = xmlReader.GetValueAsBool(PLUGIN_NAME, "PWDEncrypted", false);

                rcvPort = xmlReader.GetValueAsString(PLUGIN_NAME, "ReceivePort", "1023");
                rcvPassword = xmlReader.GetValueAsString(PLUGIN_NAME, "ReceivePassword", "");

                setLevelForMediaDuration = xmlReader.GetValueAsInt(PLUGIN_NAME, "setLevelForMediaDuration", 10);

                DebugMode = xmlReader.GetValueAsBool(PLUGIN_NAME, "DebugMode", false);
            }
            egStartInfo.CreateNoWindow = false;
            egStartInfo.UseShellExecute = true;
            if (DebugMode) Logger.Debug("EventGhost path: " + @egPath + @"\EventGhost.exe");
            egStartInfo.FileName = @egPath + @"\EventGhost.exe";
            egStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            DialogBusy = false;
        }
开发者ID:RickDB,项目名称:EventGhostPlus,代码行数:32,代码来源:EventGhostPlus.cs

示例2: InitSlideShowImages

        internal void InitSlideShowImages()
        {
            if (!Utils.UseMyPicturesSlideShow)
            return;

              var i = 0;
              logger.Info("Refreshing local MyPictures for Music SlideShow is starting.");

              var stopwatch = System.Diagnostics.Stopwatch.StartNew();
              if (Utils.MyPicturesSlideShowFolders != null && Utils.MyPicturesSlideShowFolders.Count > 0)
              {
            foreach (var folder in Utils.MyPicturesSlideShowFolders)
            {
              if (!string.IsNullOrEmpty(folder) && Directory.Exists(folder))
              {
            logger.Debug("MyPictures FanartHandler folder: "+folder) ;
            SetupSlideShowImages(folder, ref i) ;
            if (Utils.GetIsStopping())
              return ;
              }
            }
              }
              else
              {
            int MaximumShares = 250;
            using (var xmlreader = new Settings(Config.GetFile((Config.Dir) 10, "MediaPortal.xml")))
            {
              for (int index = 0; index < MaximumShares; index++)
              {
            string sharePath = String.Format("sharepath{0}", index);
            string sharePin = String.Format("pincode{0}", index);
            string sharePathData = xmlreader.GetValueAsString("pictures", sharePath, string.Empty);
            string sharePinData = xmlreader.GetValueAsString("pictures", sharePin, string.Empty);
            if (!MediaPortal.Util.Utils.IsDVD(sharePathData) && sharePathData != string.Empty && string.IsNullOrEmpty(sharePinData))
            {
              logger.Debug("MyPictures Mediaportal folder: "+sharePathData) ;
              SetupSlideShowImages(sharePathData, ref i) ;
              if (Utils.GetIsStopping())
                return ;
            }
              }
            }
              }
              stopwatch.Stop();
              logger.Info("Refreshing local MyPictures for Music SlideShow is done. Time elapsed: {0}.", stopwatch.Elapsed);
        }
开发者ID:hkjensen,项目名称:mediaportal-fanart-handler,代码行数:46,代码来源:PicturesWorker.cs

示例3: Load

    public void Load(Settings xmlreader)
    {
      fontName = xmlreader.GetValueAsString("subtitles", "fontface", "Arial");
      fontSize = xmlreader.GetValueAsInt("subtitles", "fontsize", 18);
      fontIsBold = xmlreader.GetValueAsBool("subtitles", "bold", true);
      fontCharset = xmlreader.GetValueAsInt("subtitles", "charset", 1); //default charset

      string strColor = xmlreader.GetValueAsString("subtitles", "color", "ffffff");
      int argb = Int32.Parse(strColor, System.Globalization.NumberStyles.HexNumber);
      //convert ARGB to BGR (COLORREF)
      fontColor = (int)((argb & 0x000000FF) << 16) |
                  (int)(argb & 0x0000FF00) |
                  (int)((argb & 0x00FF0000) >> 16);
      shadow = xmlreader.GetValueAsInt("subtitles", "shadow", 3);
      borderWidth = xmlreader.GetValueAsInt("subtitles", "borderWidth", 2);
      isBorderOutline = xmlreader.GetValueAsBool("subtitles", "borderOutline", true);
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:17,代码来源:SubSettings.cs

示例4: LoadAdvancedSettings

    protected override void LoadAdvancedSettings(Settings xmlreader)
    {
      int subPicsBufferAhead = xmlreader.GetValueAsInt("subtitles", "subPicsBufferAhead", 3);
      bool pow2textures = xmlreader.GetValueAsBool("subtitles", "pow2tex", false);
      string textureSize = xmlreader.GetValueAsString("subtitles", "textureSize", "Medium");
      bool disableAnimation = xmlreader.GetValueAsBool("subtitles", "disableAnimation", true);

      int w, h;
      int screenW = GUIGraphicsContext.Width;
      int screenH = GUIGraphicsContext.Height;
      bool res1080 = (screenW == 1920 && screenH == 1080);
      bool res720 = (screenW >= 1280 && screenW <= 1368 && screenH >= 720 && screenH <= 768);

      if (textureSize.Equals("Desktop"))
      {
        w = screenW;
        h = screenH;
      }
      else if (textureSize.Equals("Low"))
      {
        if (res1080)
        {
          w = 854;
          h = 480;
        }
        else if (res720)
        {
          w = 512;
          h = 288;
        }
        else
        {
          w = (int)(Math.Round(screenW / 3.0));
          h = (int)(Math.Round(screenH / 3.0));
        }
      }
      else //if (textureSize.Equals("Medium"))
      {
        if (res1080)
        {
          w = 1280;
          h = 720;
        }
        else if (res720)
        {
          w = 854;
          h = 480;
        }
        else
        {
          w = (int)(Math.Round(screenW * 2.0 / 3));
          h = (int)(Math.Round(screenH * 2.0 / 3));
        }
      }
      Log.Debug("MpcEngine: using texture size of {0}x{1}", w, h);
      Size size = new Size(w, h);
      MpcSubtitles.SetAdvancedOptions(subPicsBufferAhead, size, pow2textures, disableAnimation);
    }
开发者ID:MediaPortal,项目名称:MediaPortal-1,代码行数:58,代码来源:MpcEngine.cs

示例5: Scraper

 static Scraper()
 {
   using (var xmlreader = new Settings(Config.GetFile((Config.Dir) 10, "MediaPortal.xml")))
   {
     _strippedPrefixes = xmlreader.GetValueAsBool("musicfiles", "stripartistprefixes", false);
     _artistPrefixes = xmlreader.GetValueAsString("musicfiles", "artistprefixes", "The, Les, Die");
   }
   logger.Debug("Initialize MP stripped prefixes: " + _artistPrefixes + " - " + (_strippedPrefixes ? "True" : "False"));
 }
开发者ID:hkjensen,项目名称:mediaportal-fanart-handler,代码行数:9,代码来源:Scraper.cs

示例6: SetLanguage

    /// <summary>Gets the current MP language from mediaportal.xml and sets the Wikipedia URL accordingly</summary>
    private void SetLanguage(string language)
    {
      if (language == "Default")
      {
        Settings xmlreader = new MPSettings();
        language = xmlreader.GetValueAsString("gui", "language", "English");
      }

      Settings detailxmlreader = new Settings(Config.GetFile(Config.Dir.Config, "wikipedia.xml"));
      this.WikipediaURL = detailxmlreader.GetValueAsString(language, "imageurl", "http://en.wikipedia.org/wiki/Image:");
      Log.Info("Wikipedia: Image language set to " + language + ".");
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:13,代码来源:WikipediaImage.cs

示例7: LoadGroupAndChannelSettings

        private void LoadGroupAndChannelSettings(Settings xmlreader, ChannelType channelType, string section)
        {
            string channelName = xmlreader.GetValueAsString(section, "channel", String.Empty);

            string groupname = xmlreader.GetValueAsString(section, "group", Utility.GetLocalizedText(TextId.AllChannels));
            foreach (ChannelGroup group in _navigatorChannels[channelType].Groups)
            {
                if (group.GroupName == groupname)
                {
                    _navigatorChannels[channelType].PreviousChannelGroup = group;
                    _currentChannelGroup = group;
                    RefreshChannelsInGroup(channelType);
                    break;
                }
            }
            _navigatorChannels[channelType].LastChannelGroup = _navigatorChannels[channelType].PreviousChannelGroup;

            _navigatorChannels[channelType].PreviousChannel = null;
            foreach (Channel channel in _navigatorChannels[channelType].Channels)
            {
                if (channel.DisplayName == channelName)
                {
                    _navigatorChannels[channelType].PreviousChannel = channel;
                    break;
                }
            }
            _navigatorChannels[channelType].LastChannel = _navigatorChannels[channelType].PreviousChannel;
        }
开发者ID:Rpatrishh,项目名称:ARGUS-TV-Clients,代码行数:28,代码来源:ChannelNavigator.cs

示例8: LoadSeparators

 public static void LoadSeparators(Settings xmlreader)
 {
     try
       {
     logger.Debug("Load Separators from: "+ConfigFilename);
     int MaximumShares = 250;
     for (int index = 0; index < MaximumShares; index++)
     {
       string Separator = String.Format("sep{0}", index);
       string SeparatorData = xmlreader.GetValueAsString("Separators", Separator, string.Empty);
       if (!string.IsNullOrEmpty(SeparatorData))
       {
     Array.Resize(ref PipesArray, PipesArray.Length + 1);
     PipesArray[PipesArray.Length - 1] = SeparatorData ;
       }
     }
     logger.Debug("Load Separators from: "+ConfigFilename+" complete.");
       }
       catch (Exception ex)
       {
     logger.Error("LoadSeparators: "+ex);
       }
 }
开发者ID:hkjensen,项目名称:mediaportal-fanart-handler,代码行数:23,代码来源:Utils.cs

示例9: LoadSettings

    /// <summary>
    /// Loads the settings.
    /// </summary>
    private static void LoadSettings()
    {
      try
      {
        using (Settings xmlreader = new Settings(MPCommon.MPConfigFile))
        {
          ServerHost = xmlreader.GetValueAsString("TV2BlasterPlugin", "ServerHost", "localhost");

          // MediaPortal settings ...
          _mpBasicHome = xmlreader.GetValueAsBool("general", "startbasichome", false);
        }
      }
      catch (Exception ex)
      {
        Log.Error(ex);
      }
    }
开发者ID:astalavister,项目名称:IR-Server-Suite,代码行数:20,代码来源:TV2BlasterPlugin.cs

示例10: ScanMusicFoldersForFanarts

 public static void ScanMusicFoldersForFanarts()
 {
     logger.Info("Refreshing local fanart for Music (Music folder Artist/Album Fanart) is starting.");
       int MaximumShares = 250;
       using (var xmlreader = new Settings(Config.GetFile((Config.Dir) 10, "MediaPortal.xml")))
       {
     for (int index = 0; index < MaximumShares; index++)
     {
       string sharePath = String.Format("sharepath{0}", index);
       string sharePin = String.Format("pincode{0}", index);
       string sharePathData = xmlreader.GetValueAsString("music", sharePath, string.Empty);
       string sharePinData = xmlreader.GetValueAsString("music", sharePin, string.Empty);
       if (!MediaPortal.Util.Utils.IsDVD(sharePathData) && sharePathData != string.Empty && string.IsNullOrEmpty(sharePinData))
       {
     logger.Debug("Mediaportal Music folder: "+sharePathData) ;
     SetupFilenames(sharePathData, "fanart*.jpg", Utils.Category.MusicFanartManual, null, Utils.Provider.MusicFolder, true);
       }
     }
       }
       logger.Info("Refreshing local fanart for Music (Music folder Artist/Album fanart) is done.");
 }
开发者ID:hkjensen,项目名称:mediaportal-fanart-handler,代码行数:21,代码来源:Utils.cs

示例11: LoadGuideColors

    private bool LoadGuideColors(Settings xmlreader)
    {
      List<string> temp;

      // Load supporting guide colors.
      _guideColorChannelButton = GetColorFromString(xmlreader.GetValueAsString("tvguidecolors", "guidecolorchannelbutton", "ff0e517b"));
      _guideColorChannelButtonSelected = GetColorFromString(xmlreader.GetValueAsString("tvguidecolors", "guidecolorchannelbuttonselected", "Green"));
      _guideColorGroupButton = GetColorFromString(xmlreader.GetValueAsString("tvguidecolors", "guidecolorgroupbutton", "ff0e517b"));
      _guideColorGroupButtonSelected = GetColorFromString(xmlreader.GetValueAsString("tvguidecolors", "guidecolorgroupbuttonselected", "Green"));
      _guideColorProgramSelected = GetColorFromString(xmlreader.GetValueAsString("tvguidecolors", "guidecolorprogramselected", "Green"));
      _guideColorProgramEnded = GetColorFromString(xmlreader.GetValueAsString("tvguidecolors", "guidecolorprogramended", "Gray"));
      _guideColorBorderHighlight = GetColorFromString(xmlreader.GetValueAsString("tvguidecolors", "guidecolorborderhighlight", "99ffffff"));

      // Load the default genre colors.
      temp = new List<string>((xmlreader.GetValueAsString("tvguidecolors", "defaultgenre", String.Empty)).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
      if (temp.Count == 2)
      {
        _defaultGenreColorOnNow = GetColorFromString(temp[0]);
        _defaultGenreColorOnLater = GetColorFromString(temp[1]);
      }
      else if (temp.Count == 1)
      {
        _defaultGenreColorOnNow = GetColorFromString(temp[0]);
        _defaultGenreColorOnLater = _defaultGenreColorOnNow;
      }
      else
      {
        _defaultGenreColorOnNow = 0xff1d355b; // Dark blue
        _defaultGenreColorOnLater = 0xff0e517b; // Light blue
      }

      // Each genre color entry is a csv list.  The first value is the color for program "on now", the second value is for program "on later".
      // If only one value is provided then that value is used for both.
      long color0;
      long color1;
      MpGenre genreObj;

      for (int i = 0; i < _mpGenres.Count; i++)
      {
        // If the genre is disabled then set the program colors to the default colors.
        genreObj = _mpGenres.Find(x => x.Id == i);
        if (!genreObj.Enabled)
        {
          _genreColorsOnNow.Add(_mpGenres[i].Name, _defaultGenreColorOnNow);
          _genreColorsOnLater.Add(_mpGenres[i].Name, _defaultGenreColorOnLater);
          continue;
        }

        temp = new List<string>((xmlreader.GetValueAsString("tvguidecolors", "genre" + i.ToString(), String.Empty)).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));

        if (temp.Count > 0)
        {
          color0 = GetColorFromString(temp[0]);
          color1 = color0;
          if (temp.Count == 2)
          {
            color1 = GetColorFromString(temp[1]);
            _genreColorsOnNow.Add(_mpGenres[i].Name, color0);
            _genreColorsOnLater.Add(_mpGenres[i].Name, color1);
          }
          else if (temp.Count == 1)
          {
            _genreColorsOnNow.Add(_mpGenres[i].Name, color0);
            _genreColorsOnLater.Add(_mpGenres[i].Name, color1);
          }
        }
      }

      return true;
    }
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:70,代码来源:TvGuideBase.cs

示例12: LoadGuideColors

    private bool LoadGuideColors(Settings xmlreader)
    {
      List<string> temp;

      // Load supporting guide colors.
      _guideColorChannelButton = GetColorFromString(xmlreader.GetValueAsString("tvguidecolors", "guidecolorchannelbutton", "FF404040"));
      _guideColorChannelButtonSelected = GetColorFromString(xmlreader.GetValueAsString("tvguidecolors", "guidecolorchannelbuttonselected", "FF6495ED"));
      _guideColorGroupButton = GetColorFromString(xmlreader.GetValueAsString("tvguidecolors", "guidecolorgroupbutton", "FF404040"));
      _guideColorGroupButtonSelected = GetColorFromString(xmlreader.GetValueAsString("tvguidecolors", "guidecolorgroupbuttonselected", "FF6495ED"));
      _guideColorProgramSelected = GetColorFromString(xmlreader.GetValueAsString("tvguidecolors", "guidecolorprogramselected", "FF6495ED"));
      _guideColorProgramEnded = GetColorFromString(xmlreader.GetValueAsString("tvguidecolors", "guidecolorprogramended", "FF202020"));
      _guideColorBorderHighlight = GetColorFromString(xmlreader.GetValueAsString("tvguidecolors", "guidecolorborderhighlight", "FF6DF0FF"));

      // Load the default genre colors.
      temp = new List<string>((xmlreader.GetValueAsString("tvguidecolors", "defaultgenre", String.Empty)).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
      if (temp.Count == 2)
      {
        _guideColorProgramOnNow = GetColorFromString(temp[0]);
        _guideColorProgramOnLater = GetColorFromString(temp[1]);
      }
      else if (temp.Count == 1)
      {
        _guideColorProgramOnNow = GetColorFromString(temp[0]);
        _guideColorProgramOnLater = _guideColorProgramOnNow;
      }
      else
      {
        _guideColorProgramOnNow = 0xFF404040; // Dark blue
        _guideColorProgramOnLater = 0xFF404040; // Light blue
      }

      // Each genre color entry is a csv list.  The first value is the color for program "on now", the second value is for program "on later".
      // If only one value is provided then that value is used for both.
      long color0;
      for (int i = 0; i < _mpGenres.Count; i++)
      {
        temp = new List<string>((xmlreader.GetValueAsString("tvguidecolors", "genre" + i.ToString(), String.Empty)).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));

        if (temp.Count > 0)
        {
          color0 = GetColorFromString(temp[0]);
          if (temp.Count == 2)
          {
            _genreColorsOnNow.Add(_mpGenres[i].Name, color0);
            _genreColorsOnLater.Add(_mpGenres[i].Name, GetColorFromString(temp[1]));
          }
          else if (temp.Count == 1)
          {
            _genreColorsOnNow.Add(_mpGenres[i].Name, color0);
            _genreColorsOnLater.Add(_mpGenres[i].Name, color0);
          }
        }
      }

      return _genreColorsOnNow.Count > 0;
    }
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:56,代码来源:DlgSkinSettings.cs

示例13: LoadSettings

    private void LoadSettings()
    {
      buttonApply.Enabled = false;

      using (_settings = new MPSettings())
      {
        // Detect singleseat/multiseat
        string tvPluginDll;
        string hostName;

        tvPluginDll = Config.GetSubFolder(Config.Dir.Plugins, "windows") + @"\" + "TvPlugin.dll";
        if (File.Exists(tvPluginDll))
        {
          hostName = _settings.GetValueAsString("tvservice", "hostname", String.Empty);
          if (hostName != String.Empty && PowerManager.IsLocal(hostName))
          {
            _singleSeat = true;
            Text = "PowerScheduler Client Plugin (TV-Server on local system)";
          }
          else if (hostName == String.Empty)
          {
            _singleSeat = false;
            Text = "PowerScheduler Client Plugin (No TV-Server configured)";
          }
          else
          {
            _singleSeat = false;
            Text = "PowerScheduler Client Plugin (TV-Server on " + hostName + ")";
          }
        }
        else
        {
          _singleSeat = false;
          Text = "PowerScheduler Client Plugin (No TV-plugin installed)";
        }

        if (_singleSeat)
        {
          textBoxProfile.Text = "Standby / wakeup settings have to be made in the TV-Server Configuration";
          comboBoxProfile.Visible = false;
          flowLayoutPanelIdleTimeout.Visible = false;
          buttonExpertMode.Visible = false;
          labelExpertMode.Visible = false;
          
          tabControl.Controls.Remove(tabPageReboot);
          tabControl.Controls.Remove(tabPageProcesses);
          tabControl.Controls.Remove(tabPageNetwork);
          tabControl.Controls.Remove(tabPageShares);
          tabControl.Controls.Remove(tabPageAdvanced);

          checkBoxHomeOnly.Checked = Convert.ToBoolean(GetSetting("HomeOnly", "false"));
          textBoxCommand.Text = GetSetting("Command", string.Empty);

          return;
        }

#endif
        // Update settings of old PS versions
        UpdateSettings();

        bool buttonApplyEnabled = false;

        // General
        int profile = Convert.ToInt32(GetSetting("Profile", "-1"));
#if SERVER
        if (profile < 0 || profile > 3)
#else
        if (profile < 0 || profile > 2)
#endif
        {
          profile = GetSystemProfile();
          buttonApplyEnabled = true;
        }
        comboBoxProfile.SelectedIndex = profile;

        int idleTimeout = Convert.ToInt32(GetSetting("IdleTimeout", "-1"));
        if (idleTimeout == -1)
        {
          idleTimeout = (int)(PowerManager.RunningOnAC ? _defaultSettingsDesktopAC.idleTimeout : _defaultSettingsDesktopDC.idleTimeout);
          buttonApplyEnabled = true;
        }
        numericUpDownIdleTimeout.Value = idleTimeout;

        labelExpertMode.Text = Convert.ToBoolean(GetSetting("ExpertMode", "false")) ? "Expert Mode" : "Plug&&Play Mode";
        if (labelExpertMode.Text == "Expert Mode")
        {
          comboBoxProfile.ForeColor = SystemColors.GrayText;
          buttonExpertMode.Text = "-> Plug&&Play Mode";
        }
        else
        {
          checkBoxEPGPreventStandby.Visible = false;
          checkBoxEPGAwayMode.Visible = false;
          labelEPGCommand.Visible = false;
          textBoxEPGCommand.Visible = false;
          buttonEPGCommand.Visible = false;

          labelRebootCommand.Visible = false;
          textBoxRebootCommand.Visible = false;
          buttonRebootCommand.Visible = false;
//.........这里部分代码省略.........
开发者ID:splatterpop,项目名称:MediaPortal-1,代码行数:101,代码来源:PowerSchedulerSetup.cs

示例14: LoadSettings

    /// <summary>
    /// load settings from configuration
    /// </summary>
    /// <returns></returns>
    public bool LoadSettings(string ImportFileName)
    {
      string tmpConfigFileName = Config.GetFile(Config.Dir.Config, SettingsFileName);
      if (ImportFileName != string.Empty)
      {
        tmpConfigFileName = ImportFileName;
      }

      using (Settings reader = new Settings(tmpConfigFileName))
      {
        verboseLog = reader.GetValueAsBool(ViewModeSwitcherSectionName, ParmVerboselog, false);
        ShowSwitchMsg = reader.GetValueAsBool(ViewModeSwitcherSectionName, ParmShowSwitchMsg, false);
        UseFallbackRule = reader.GetValueAsBool(ViewModeSwitcherSectionName, ParmUseFallbackRule, true);
        String tmpFallbackViewMode = reader.GetValueAsString(ViewModeSwitcherSectionName, ParmFallbackViewMode, "Normal");
        FallBackViewMode = StringToViewMode(tmpFallbackViewMode);
        DisableLBGlobaly = reader.GetValueAsBool(ViewModeSwitcherSectionName, ParmDisableLBGlobaly, false);        
        LBMaxBlackLevel = Math.Min(Math.Max(reader.GetValueAsInt(ViewModeSwitcherSectionName, ParmBlackLevel, 32), 4), 255);
        LBMinBlackLevel = Math.Min(Math.Max(reader.GetValueAsInt(ViewModeSwitcherSectionName, ParmMinBlackLevel, 16), 4), 255);
        fboverScan = reader.GetValueAsInt(ViewModeSwitcherSectionName, FallBackOverScan, 8);
        CropLeft = reader.GetValueAsInt("tv", "cropleft", 0);
        CropRight = reader.GetValueAsInt("tv", "cropright", 0);
        CropTop = reader.GetValueAsInt("tv", "croptop", 0);
        CropBottom = reader.GetValueAsInt("tv", "cropbottom", 0);      
        disableForVideo = reader.GetValueAsBool(ViewModeSwitcherSectionName, ParmDisableForVideo, false);  
        disableLBForVideo = reader.GetValueAsBool(ViewModeSwitcherSectionName, ParmDisableLBForVideo, false);                
        LBSymLimitPercent = Math.Min(Math.Max(reader.GetValueAsInt(ViewModeSwitcherSectionName, ParmSymLimitPercent, 10), 5), 90);        
        LBdetectInterval = Math.Min(Math.Max(reader.GetValueAsInt(ViewModeSwitcherSectionName, ParmLBdetectInterval, 4), 2), 120);
        LBMaxCropLimitPercent = Math.Min(Math.Max(reader.GetValueAsInt(ViewModeSwitcherSectionName, ParmMaxCropLimitPercent, 12), 0), 50);          
        DetectWidthPercent = Math.Min(Math.Max(reader.GetValueAsInt(ViewModeSwitcherSectionName, ParmDetectWidthPercent, 40), 10), 90);  
        DetectHeightPercent = Math.Min(Math.Max(reader.GetValueAsInt(ViewModeSwitcherSectionName, ParmDetectHeightPercent, 40), 10), 90);                

        if (verboseLog)
        {                   
          Log.Debug("ViewModeSwitcher: Global Rule, ShowSwitchMsg:         " + ShowSwitchMsg);
          Log.Debug("ViewModeSwitcher: Global Rule, UseFallbackRule:       " + UseFallbackRule);
          Log.Debug("ViewModeSwitcher: Global Rule, FallBackViewMode:      " + FallBackViewMode);
          Log.Debug("ViewModeSwitcher: Global Rule, FallbackOverscan:      " + fboverScan);
          Log.Debug("ViewModeSwitcher: Global Rule, DisableBBDetect:       " + DisableLBGlobaly);
          Log.Debug("ViewModeSwitcher: Global Rule, BBMaxBlackLevel:       " + LBMaxBlackLevel);
          Log.Debug("ViewModeSwitcher: Global Rule, BBMinBlackLevel:       " + LBMinBlackLevel);
          Log.Debug("ViewModeSwitcher: Global Rule, BBSymLimitPercent:     " + LBSymLimitPercent);
          Log.Debug("ViewModeSwitcher: Global Rule, BBdetectInterval:      " + LBdetectInterval);
          Log.Debug("ViewModeSwitcher: Global Rule, BBMaxCropLimPercent:   " + LBMaxCropLimitPercent);          
          Log.Debug("ViewModeSwitcher: Global Rule, BBDetectWidthPercent:  " + DetectWidthPercent);          
          Log.Debug("ViewModeSwitcher: Global Rule, BBDetectHeightPercent: " + DetectHeightPercent);          
          Log.Debug("ViewModeSwitcher: Global Rule, disableForVideo:       " + disableForVideo);
          Log.Debug("ViewModeSwitcher: Global Rule, disableBBForVideo:     " + disableLBForVideo);
        }

        bool tmpReturn = false;
        ViewModeRules.Clear();
        int tmpRuleCount = reader.GetValueAsInt(ViewModeSwitcherSectionName, ParmRuleCount, 0);
        if (tmpRuleCount <= 0)
        {
          Rule tmpRule = new Rule();
          tmpRule.Enabled = true;
          tmpRule.Name = "4:3 SD";
          tmpRule.ARFrom = 1.2;
          tmpRule.ARTo = 1.46;
          tmpRule.MinWidth = 200;
          tmpRule.MaxWidth = 799;
          tmpRule.MinHeight = 200;
          tmpRule.MaxHeight = 599;
          tmpRule.ViewMode = Geometry.Type.Zoom14to9;
          tmpRule.OverScan = 8;
          tmpRule.EnableLBDetection = true;
          tmpRule.AutoCrop = true;
          tmpRule.MaxCrop = true;
          ViewModeRules.Add(tmpRule);

          tmpRule = new Rule();
          tmpRule.Enabled = true;
          tmpRule.Name = "4:3 HD";
          tmpRule.ARFrom = 1.2;
          tmpRule.ARTo = 1.46;
          tmpRule.MinWidth = 800;
          tmpRule.MaxWidth = 2000;
          tmpRule.MinHeight = 600;
          tmpRule.MaxHeight = 2000;
          tmpRule.ViewMode = Geometry.Type.Zoom14to9;
          tmpRule.OverScan = 16;
          tmpRule.EnableLBDetection = false;
          tmpRule.AutoCrop = false;
          tmpRule.MaxCrop = true;
          ViewModeRules.Add(tmpRule);

          tmpRule = new Rule();
          tmpRule.Enabled = true;
          tmpRule.Name = "16:9 SD";
          tmpRule.ARFrom = 1.7;
          tmpRule.ARTo = 1.9;
          tmpRule.MinWidth = 200;
          tmpRule.MaxWidth = 799;
          tmpRule.MinHeight = 200;
          tmpRule.MaxHeight = 599;
          tmpRule.ViewMode = Geometry.Type.Normal;
//.........这里部分代码省略.........
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:101,代码来源:ViewModeSwitcherSettings.cs

示例15: LoadSettings

    /// <summary>
    /// Loads the settings.
    /// </summary>
    private static void LoadSettings()
    {
      try
      {
        using (Settings xmlreader = new Settings(MPCommon.MPConfigFile))
        {
          ServerHost = xmlreader.GetValueAsString("MPControlPlugin", "ServerHost", "localhost");

          RequireFocus = xmlreader.GetValueAsBool("MPControlPlugin", "RequireFocus", true);
          MultiMappingEnabled = xmlreader.GetValueAsBool("MPControlPlugin", "MultiMappingEnabled", false);
          MultiMappingButton =
            (RemoteButton) xmlreader.GetValueAsInt("MPControlPlugin", "MultiMappingButton", (int) RemoteButton.Start);
          EventMapperEnabled = xmlreader.GetValueAsBool("MPControlPlugin", "EventMapperEnabled", false);
          MouseModeButton =
            (RemoteButton) xmlreader.GetValueAsInt("MPControlPlugin", "MouseModeButton", (int) RemoteButton.Teletext);
          MouseModeEnabled = xmlreader.GetValueAsBool("MPControlPlugin", "MouseModeEnabled", false);
          MouseModeStep = xmlreader.GetValueAsInt("MPControlPlugin", "MouseModeStep", 10);
          MouseModeAcceleration = xmlreader.GetValueAsBool("MPControlPlugin", "MouseModeAcceleration", true);

          // MediaPortal settings ...
          _mpBasicHome = xmlreader.GetValueAsBool("general", "startbasichome", false);
        }
      }
      catch (Exception ex)
      {
        Log.Error(ex);
      }
    }
开发者ID:Azzuro,项目名称:IR-Server-Suite,代码行数:31,代码来源:MPControlPlugin.cs


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