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


C# Profile.MPSettings.SetValueAsBool方法代码示例

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


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

示例1: SaveSettings

    private void SaveSettings()
    {
      using (Profile.Settings xmlwriter = new Profile.MPSettings())
      {
        xmlwriter.SetValueAsBool("general", "startfullscreen", _cmStartfullscreen.Selected);
        xmlwriter.SetValueAsBool("general", "usefullscreensplash", _cmUsefullscreensplash.Selected);
        xmlwriter.SetValueAsBool("general", "keepstartfullscreen", _cmkeepstartfullscreen.Selected);
        xmlwriter.SetValueAsBool("general", "alwaysontop", _cmAlwaysontop.Selected);
        try
        {
          if (_cmAlwaysontop.Selected) // always on top
          {
            using (RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop", true))
            {
              if (subkey != null) subkey.SetValue("ForegroundLockTimeout", 0);
            }
          }
        }
        // ReSharper disable EmptyGeneralCatchClause
        catch (Exception) { }
        // ReSharper restore EmptyGeneralCatchClause

        xmlwriter.SetValueAsBool("general", "hidetaskbar", _cmHidetaskbar.Selected);
        xmlwriter.SetValueAsBool("general", "autostart", _cmAutostart.Selected);
        try
        {
          if (_cmAutostart.Selected) // autostart on boot
          {
        Log.Debug("AUTOSTART");
            string fileName = Config.GetFile(Config.Dir.Base, "MediaPortal.exe");
            using (RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true))
            {
              if (subkey != null)
              {
                subkey.SetValue("MediaPortal", fileName);
              }
            }
          }
          else
          {
            using (RegistryKey subkey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true))
            {
              if (subkey != null)
              {
                subkey.DeleteValue("MediaPortal", false);
              }
            }
          }
        }
        // ReSharper disable EmptyGeneralCatchClause
        catch (Exception) { }
        // ReSharper restore EmptyGeneralCatchClause

        xmlwriter.SetValueAsBool("general", "minimizeonstartup", _cmMinimizeonstartup.Selected);
        xmlwriter.SetValueAsBool("general", "minimizeonexit", _cmMinimizeonexit.Selected);
        xmlwriter.SetValueAsBool("general", "minimizeonfocusloss", _cmMinimizeonfocusloss.Selected);
      }
    }
开发者ID:cmendozac,项目名称:MediaPortal-1,代码行数:58,代码来源:GUISettingsGeneral_Startup.cs

示例2: SaveSettings

    private void SaveSettings()
    {
      using (Profile.Settings xmlwriter = new Profile.MPSettings())
      {
        xmlwriter.SetValueAsBool("movies", "markwatched", btnMarkWatched.Selected);
        xmlwriter.SetValueAsBool("movies", "keepfolderstogether", btnKeepFoldersTogether.Selected);
        xmlwriter.SetValueAsBool("comskip", "automaticskip", btnCommercialSkip.Selected);

        xmlwriter.SetValue("movies", "playedpercentagewatched", _watchedPercentage);
        xmlwriter.SetValue("FFDShow", "audiodelayInterval", _videoAudioDelay);
      }
    }
开发者ID:hkjensen,项目名称:MediaPortal-1,代码行数:12,代码来源:GUISettingsMyVideos_OtherSettings.cs

示例3: SaveSettings

    private void SaveSettings()
    {
      using (Profile.Settings xmlwriter = new Profile.MPSettings())
      {
        xmlwriter.SetValueAsBool("musicmisc", "fetchlastfmcovers", !btnFetchlastfmcovers.Selected);
        xmlwriter.SetValueAsBool("musicmisc", "fetchlastfmtopalbums", !btnFetchlastfmtopalbums.Selected);
        xmlwriter.SetValueAsBool("musicmisc", "fetchlastfmtracktags", !btnFetchlastfmtracktags.Selected);
        xmlwriter.SetValueAsBool("musicmisc", "switchArtistOnLastFMSubmit", btnSwitchArtistOnLastFMSubmit.Selected);

        xmlwriter.SetValue("musicmisc", "vumeter", _vuMeter.ToLowerInvariant());
      }
    }
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:12,代码来源:GUISettingsMusic_NowPlaying.cs

示例4: SaveSettings

 private void SaveSettings()
 {
   using (Profile.Settings xmlWriter = new Profile.MPSettings())
   {
     xmlWriter.SetValueAsBool("home", "scrollfixed", chkboxFixScrollbar.Checked);
     xmlWriter.SetValueAsBool("home", "usemyplugins", chkBoxUseMyPlugins.Checked);
     xmlWriter.SetValueAsBool("home", "enableanimation", chkBoxAnimation.Checked);
     xmlWriter.SetValueAsBool("home", "LongTimeFormat", checkBoxShowSeconds.Checked);
     xmlWriter.SetValue("home", "dateformat", cboxFormat.Text);
   }
   SaveMenuSorting();
 }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:12,代码来源:GUIHomeSetupForm.cs

示例5: SaveSettings

 private void SaveSettings()
 {
   using (Profile.Settings xmlwriter = new Profile.MPSettings())
   {
     xmlwriter.SetValueAsBool("audioscrobbler", "showtrayicon", checkBoxUseTrayIcon.Checked);
     xmlwriter.SetValueAsBool("audioscrobbler", "showballontips", checkBoxShowBallonTips.Checked);
     xmlwriter.SetValueAsBool("audioscrobbler", "submitradiotracks", checkBoxSubmitToProfile.Checked);
     xmlwriter.SetValueAsBool("audioscrobbler", "directskip", checkBoxDirectSkip.Checked);
     xmlwriter.SetValue("audioscrobbler", "listentrycount", numericUpDownListEntries.Value);
     xmlwriter.SetValue("audioscrobbler", "streamplayertype", 0); // comboBoxStreamPlayerType.SelectedIndex);
     xmlwriter.SetValueAsBool("audioscrobbler", "oneclickstart", checkBoxOneClickMode.Checked);
   }
 }
开发者ID:sekotin,项目名称:MediaPortal-1,代码行数:13,代码来源:PluginSetupForm.cs

示例6: SaveSettings

 private void SaveSettings()
 {
   using (Profile.Settings xmlreader = new Profile.MPSettings())
   {
     xmlreader.SetValueAsBool("musicfiles", "autoshuffle", m_bAutoShuffle);
   }
 }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:7,代码来源:GUISettingsMusic.cs

示例7: SaveSettings

 private void SaveSettings()
 {
   using (Profile.Settings xmlwriter = new Profile.MPSettings())
   {
     xmlwriter.SetValueAsBool("musicmisc", "lookupSimilarTracks", !btnDisableSimilarTrackLookup.Selected);
     xmlwriter.SetValue("musicmisc", "vumeter", _vuMeter.ToLowerInvariant());
   }
 }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:8,代码来源:GUISettingsMusic_NowPlaying.cs

示例8: OnPageDestroy

 protected override void OnPageDestroy(int newWindowId)
 {
   currentSelectedItem = facadeLayout.SelectedListItemIndex;
   using (Profile.Settings settings = new Profile.MPSettings())
   {
     settings.SetValueAsBool("movies", "repeat", playlistPlayer.RepeatPlaylist);
   }
   base.OnPageDestroy(newWindowId);
 }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:9,代码来源:GUIVideoPlaylist.cs

示例9: SaveShare

    private static void SaveShare(IList sharesList, string mediaType)
    {
      using (Profile.Settings xmlwriter = new Profile.MPSettings())
      {
        for (int index = 0; index < MaximumShares; index++)
        {
          string shareName = String.Format("sharename{0}", index);
          string sharePath = String.Format("sharepath{0}", index);
          string sharePin = String.Format("pincode{0}", index);

          string shareType = String.Format("sharetype{0}", index);
          string shareServer = String.Format("shareserver{0}", index);
          string shareLogin = String.Format("sharelogin{0}", index);
          string sharePwd = String.Format("sharepassword{0}", index);
          string sharePort = String.Format("shareport{0}", index);
          string shareRemotePath = String.Format("shareremotepath{0}", index);

          string shareNameData = string.Empty;
          string sharePathData = string.Empty;
          string sharePinData = string.Empty;

          bool shareTypeData = false;
          string shareServerData = string.Empty;
          string shareLoginData = string.Empty;
          string sharePwdData = string.Empty;
          int sharePortData = 21;
          string shareRemotePathData = string.Empty;

          if (sharesList != null && sharesList.Count > index)
          {
            Share shareData = sharesList[index] as Share;

            if (shareData != null)
            {
              shareNameData = shareData.Name;
              sharePathData = shareData.Path;
              sharePinData = shareData.Pincode;

              shareTypeData = shareData.IsFtpShare;
              shareServerData = shareData.FtpServer;
              shareLoginData = shareData.FtpLoginName;
              sharePwdData = shareData.FtpPassword;
              sharePortData = shareData.FtpPort;
              shareRemotePathData = shareData.FtpFolder;
            }
          }

          xmlwriter.SetValue(mediaType, shareName, shareNameData);
          xmlwriter.SetValue(mediaType, sharePath, sharePathData);
          xmlwriter.SetValue(mediaType, sharePin, Util.Utils.EncryptPassword(sharePinData));

          xmlwriter.SetValueAsBool(mediaType, shareType, shareTypeData);
          xmlwriter.SetValue(mediaType, shareServer, shareServerData);
          xmlwriter.SetValue(mediaType, shareLogin, shareLoginData);
          xmlwriter.SetValue(mediaType, sharePwd, Util.Utils.EncryptPassword(sharePwdData));
          xmlwriter.SetValue(mediaType, sharePort, sharePortData.ToString());
          xmlwriter.SetValue(mediaType, shareRemotePath, shareRemotePathData);
        }
      }
    }
开发者ID:cmendozac,项目名称:MediaPortal-1,代码行数:60,代码来源:VirtualDirectory.cs

示例10: OnShuffleSlideShows

 private void OnShuffleSlideShows()
 {
   using (Profile.Settings xmlwriter = new Profile.MPSettings())
   {
     xmlwriter.SetValueAsBool("pictures", "autoShuffle", cmShuffleSlideShows.Selected);
   }
 }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:7,代码来源:GUISettingsSlideShow.cs

示例11: OnPageDestroy

    protected override void OnPageDestroy(int newWindowId)
    {
      // set back Sort by sorttitle
      using (Profile.Settings xmlwriter = new Profile.MPSettings())
      {
        xmlwriter.SetValueAsBool("moviedatabase", "usesorttitle", _useSortTitle);
      }

      if (_setThumbs != null && _setThumbs.IsAlive)
      {
        _setThumbs.Abort();
        _setThumbs = null;
      }
      
      // Set folder history when video window is not actually left (ie.: play movie, video info..)
      if (IsVideoWindow(newWindowId))
      {
        if (facadeLayout != null)
        {
          _history.Set(facadeLayout.SelectedListItemIndex.ToString(), _currentFolder);
        }
      }
      else // For real exit (ie.: to home, reset folder history)
      {
        _history.Set("0", _currentFolder);
      }

      SaveFolderSettings(_currentFolder);
      ReleaseResources();
      base.OnPageDestroy(newWindowId);
    }
开发者ID:gayancc,项目名称:MediaPortal-1,代码行数:31,代码来源:GUIVideoFiles.cs

示例12: SaveSettings

 private void SaveSettings()
 {
   using (Profile.Settings xmlwriter = new Profile.MPSettings())
   {
     xmlwriter.SetValueAsBool("general", "turnoffmonitor", cmTurnoffmonitor.Selected);
     xmlwriter.SetValueAsBool("general", "turnmonitoronafterresume", cmTurnmonitoronafterresume.Selected);
     xmlwriter.SetValueAsBool("general", "enables3trick", cmEnables3trick.Selected);
     xmlwriter.SetValueAsBool("general", "useS3Hack", cmUseS3Hack.Selected);
     xmlwriter.SetValueAsBool("general", "restartonresume", cmRestartonresume.Selected);
     xmlwriter.SetValueAsBool("general", "showlastactivemodule", cmShowlastactivemodule.Selected);
     xmlwriter.SetValueAsBool("screenselector", "usescreenselector", cmUsescreenselector.Selected);
     xmlwriter.SetValueAsBool("general", "delay startup", cmDelayStartup.Selected);
     xmlwriter.SetValueAsBool("general", "delay resume", cmDelayResume.Selected);
   }
 }
开发者ID:edterbak,项目名称:MediaPortal-1,代码行数:15,代码来源:GUISettingsGeneral_Resume.cs

示例13: PageDestroy

    public void PageDestroy()
    {
      if (!_keyboard._useSearchLayout && !_keyboard._password)
      {
        using (MediaPortal.Profile.MPSettings xmlwriter = new Profile.MPSettings())
        {
          xmlwriter.SetValueAsBool("general", "smsstyleinput", _keyboard.SmsStyleText);
        }
      }
      GUIWindowManager.IsSwitchingToNewWindow = true;
      lock (this)
      {
        base.OnPageDestroy(_parentWindowId);
        GUIGraphicsContext.Overlay = _previousOverlayVisible;
        Dispose();

        GUIWindowManager.UnRoute();
        _parentWindow = null;
      }
      GUIWindowManager.IsSwitchingToNewWindow = false;
      GUILayerManager.UnRegisterLayer(this);

      Log.Debug("Window: {0} deinit", ToString());
    }
开发者ID:nio22,项目名称:MediaPortal-1,代码行数:24,代码来源:GUIDialogVirtualKeyboard.cs

示例14: SaveSettings

    private void SaveSettings()
    {
      using (Profile.Settings xmlwriter = new Profile.MPSettings())
      {
        xmlwriter.SetValue("pictures", "speed", m_iSpeed.ToString());
        xmlwriter.SetValue("pictures", "transition", m_iTransistion.ToString());
        xmlwriter.SetValue("pictures", "kenburnsspeed", m_iKenBurnsSpeed.ToString());
        xmlwriter.SetValueAsBool("pictures", "kenburns", m_bKenBurns);
        xmlwriter.SetValueAsBool("pictures", "random", m_bRandom);

        xmlwriter.SetValueAsBool("pictures", "autoRepeat", cmLoopSlideShows.Selected);
        xmlwriter.SetValueAsBool("pictures", "autoShuffle", cmShuffleSlideShows.Selected);
        xmlwriter.SetValueAsBool("pictures", "useExif", cmExifSlideShows.Selected);
        xmlwriter.SetValueAsBool("pictures", "usePicasa", cmPicasaSlideShows.Selected);
        xmlwriter.SetValueAsBool("pictures", "useDayGrouping", cmGroupByDaySlideShows.Selected);
        xmlwriter.SetValueAsBool("pictures", "enableVideoPlayback", cmEnablePlaySlideShows.Selected);
        xmlwriter.SetValueAsBool("pictures", "playVideosInSlideshows", cmPlayInSlideShows.Selected);
      }
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:19,代码来源:GUISettingsPictures_Slideshow.cs

示例15: OnPageDestroy

 protected override void OnPageDestroy(int newWindowId)
 {
   m_iItemSelected = facadeLayout.SelectedListItemIndex;
   using (Profile.Settings settings = new Profile.MPSettings())
   {
     settings.SetValueAsBool("musicfiles", "repeat", playlistPlayer.RepeatPlaylist);
   }
   HideWaitCursor();
   base.OnPageDestroy(newWindowId);
 }
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:10,代码来源:GUIMusicPlaylist.cs


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