public void Load() { using (var xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { this.PluginName = xmlreader.GetValueAsString("youtubevideos", "PluginName", "YouTube.fm"); this.Region = xmlreader.GetValueAsString("youtubevideos", "Region", "Ask"); this.InitialDisplay = xmlreader.GetValueAsInt("youtubevideos", "InitialDisplay", 3); this.User = xmlreader.GetValueAsString("youtubevideos", "user", string.Empty); this.Password = xmlreader.GetValueAsString("youtubevideos", "password", string.Empty); this.InitialCat = xmlreader.GetValueAsInt("youtubevideos", "InitialCat", 1); this.VideoQuality = xmlreader.GetValueAsInt("youtubevideos", "VideoQuality", 0); this.InstantAction = (Action.ActionType)xmlreader.GetValueAsInt("youtubevideos", "InstantAction", (int)(Action.ActionType.REMOTE_1)); this.InitialSearch = xmlreader.GetValueAsString("youtubevideos", "InitialSearch", string.Empty); this.InstantChar = xmlreader.GetValueAsInt("youtubevideos", "InstantCharInt", 01); this.MusicFilter = xmlreader.GetValueAsBool("youtubevideos", "MusicFilter", true); this.UseSMSStyleKeyBoard = xmlreader.GetValueAsBool("youtubevideos", "UseSMSStyleKeyBoard", true); string his = xmlreader.GetValueAsString("youtubevideos", "searchhistory", string.Empty); this.Time = xmlreader.GetValueAsBool("youtubevideos", "time", false); this.ShowNowPlaying = xmlreader.GetValueAsBool("youtubevideos", "ShowNowPlaying", true); this.UseYouTubePlayer = xmlreader.GetValueAsBool("youtubevideos", "UseYouTubePlayer", false); this.UseExtremFilter = xmlreader.GetValueAsBool("youtubevideos", "UseExtremFilter", false); this.LoadOnlineFanart = xmlreader.GetValueAsBool("youtubevideos", "LoadOnlineFanart", true); this.FanartDir = xmlreader.GetValueAsString("youtubevideos", "FanartFolder", string.Empty); this.DownloadFolder = xmlreader.GetValueAsString("youtubevideos", "DownloadFolder", Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments) + "\\My Videos"); foreach (string s in his.Split('|')) { if (!string.IsNullOrEmpty(s.Trim())) { SearchHistory.Add(s); } } } this.LocalFile.Load(); }
public SearchViewModel() : base("検索") { SearchResult = new SearchResultViewModel(this); //検索 CurrentSearch = new NicoNicoSearch(this); foreach (var entry in Settings.Instance.SearchHistory) { SearchHistory.Add(new SearchHistoryViewModel(this, entry)); } }
public void Load() { using (var xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { this.PluginName = xmlreader.GetValueAsString("youtubevideos", "PluginName", "YouTube.fm"); this.User = xmlreader.GetValueAsString("youtubevideos", "user", string.Empty); this.Password = xmlreader.GetValueAsString("youtubevideos", "password", string.Empty); this.StartUpOpt = xmlreader.GetValueAsInt("youtubevideos", "StartUpOpt", 0); this.VideoQuality = xmlreader.GetValueAsInt("youtubevideos", "VideoQuality", 0); this.LayoutItem = xmlreader.GetValueAsInt("youtubevideos", "LayoutItem", 0); this.LayoutArtist = xmlreader.GetValueAsInt("youtubevideos", "LayoutArtist", 2); this.LayoutVideo = xmlreader.GetValueAsInt("youtubevideos", "LayoutVideo", 5); this.MusicFilter = xmlreader.GetValueAsBool("youtubevideos", "MusicFilter", true); string his = xmlreader.GetValueAsString("youtubevideos", "searchhistory", string.Empty); this.ShowNowPlaying = xmlreader.GetValueAsBool("youtubevideos", "ShowNowPlaying", true); this.UseExtremFilter = xmlreader.GetValueAsBool("youtubevideos", "UseExtremFilter", false); this.LoadOnlineFanart = xmlreader.GetValueAsBool("youtubevideos", "LoadOnlineFanart", true); this.CacheDir = xmlreader.GetValueAsString("youtubevideos", "CacheDir", string.Empty); this.FanartDir = xmlreader.GetValueAsString("youtubevideos", "FanartFolder", string.Empty); this.DownloadFolder = xmlreader.GetValueAsString("youtubevideos", "DownloadFolder", Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\Videos"); this.LastFmUser = xmlreader.GetValueAsString("youtubevideos", "LastFmUser", string.Empty); this.LastFmPass = xmlreader.GetValueAsString("youtubevideos", "LastFmPass", string.Empty); this.LastFmNowPlay = xmlreader.GetValueAsBool("youtubevideos", "LastFmNowPlay", false); this.LastFmSubmit = xmlreader.GetValueAsBool("youtubevideos", "LastFmSubmit", false); this.UseAsServer = xmlreader.GetValueAsBool("youtubevideos", "UseAsServer", false); this.PortNumber = xmlreader.GetValueAsInt("youtubevideos", "PortNumber", 18944); this.UseDefaultOSD = xmlreader.GetValueAsBool("youtubevideos", "UseDefaultOSD", false); foreach (string s in his.Split('|')) { if (!string.IsNullOrEmpty(s.Trim())) { SearchHistory.Add(s); } } } if (string.IsNullOrEmpty(CacheDir)) { CacheDir = Config.GetFile(Config.Dir.Thumbs, @"Youtube.Fm\Cache"); } if (string.IsNullOrEmpty(FanartDir)) { FanartDir = Config.GetFile(Config.Dir.Thumbs, @"Youtube.Fm\Fanart\", "%artist%.png"); } this.LocalFile.Load(); MainMenu.Load("youtubefmMenu.xml"); }
private async Task RefreshSearchHistoryAsync() { var items = await PlannerService.GetListFromStoreAsync(); SearchHistory.Clear(); foreach (var item in items) { SearchHistory.Add(item); } RaisePropertyChanged(() => SearchHistory); RaisePropertyChanged(() => SearchHistorySmall); }
public void Load() { using ( MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { Mp3 = xmlreader.GetValueAsBool("radiotime", "mp3", true); Wma = xmlreader.GetValueAsBool("radiotime", "wma", true); Real = xmlreader.GetValueAsBool("radiotime", "real", false); ShowPresets = xmlreader.GetValueAsBool("radiotime", "showpresets", false); UseVideo = xmlreader.GetValueAsBool("radiotime", "UseVideo", false); JumpNowPlaying = xmlreader.GetValueAsBool("radiotime", "JumpNowPlaying", false); User = xmlreader.GetValueAsString("radiotime", "user", string.Empty); Password = xmlreader.GetValueAsString("radiotime", "password", string.Empty); FolderId = xmlreader.GetValueAsString("radiotime", "FolderId", string.Empty); PluginName = xmlreader.GetValueAsString("radiotime", "pluginname", "RadioTime"); StartWithFastPreset = xmlreader.GetValueAsBool("radiotime", "StartWithFastPreset", false); SearchHistory.Clear(); ArtistSearchHistory.Clear(); string searchs = xmlreader.GetValueAsString("radiotime", "searchHistory", ""); if (!string.IsNullOrEmpty(searchs)) { string[] array = searchs.Split('|'); for (int i = 0; i < array.Length && i < 25; i++) { if (!string.IsNullOrEmpty(array[i])) { SearchHistory.Add(array[i]); } } } searchs = xmlreader.GetValueAsString("radiotime", "artistSearchHistory", ""); if (!string.IsNullOrEmpty(searchs)) { string[] array = searchs.Split('|'); for (int i = 0; i < array.Length && i < 25; i++) { if (!string.IsNullOrEmpty(array[i])) { ArtistSearchHistory.Add(array[i]); } } } PartnerId = "41"; } }
internal FindTaggedPagesModel(OneNoteProxy onenote) : base(onenote) { _searchResult = new FilterablePageCollection(OneNoteApp); _searchResult.Tags.CollectionChanged += HandleTagCollectionChanges; _searchResult.FilteredPages.CollectionChanged += HandlePageCollectionChanges; CurrentPageTitle = Properties.Resources.TagSearch_CheckBox_Tracking_Text; // load the search history if (!string.IsNullOrEmpty(Properties.Settings.Default.SearchHistory)) { string[] searches = Properties.Settings.Default.SearchHistory.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < searches.Length && i < Properties.Settings.Default.SearchHistory_Size; i++) { SearchHistory.Add(searches[i].Trim()); } } }
private void InsertPlaceIntoSearchHistoryIfNotExist(string searchQuery) { if (string.IsNullOrWhiteSpace(searchQuery)) { return; } if (SearchHistory.Contains(searchQuery)) { return; } SearchHistory.Add(searchQuery); toaster.Info($"Place '{searchQuery}' is added to your search history"); NotifyStateChanged(); SetSearchHistory(); }
public void Load() { var passwordNeedsUpdate = false; using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.MPSettings()) { Mp3 = xmlreader.GetValueAsBool("radiotime", "mp3", true); Wma = xmlreader.GetValueAsBool("radiotime", "wma", true); Real = xmlreader.GetValueAsBool("radiotime", "real", false); ShowPresets = xmlreader.GetValueAsBool("radiotime", "showpresets", false); UseVideo = xmlreader.GetValueAsBool("radiotime", "UseVideo", false); JumpNowPlaying = xmlreader.GetValueAsBool("radiotime", "JumpNowPlaying", false); User = xmlreader.GetValueAsString("radiotime", "user", string.Empty); var encryptedPassword = xmlreader.GetValueAsString("radiotime", "encryptedPassword", string.Empty); if (!string.IsNullOrEmpty(encryptedPassword)) { { Password = PasswordUtility.DecryptData(encryptedPassword, DataProtectionScope.LocalMachine); if (string.IsNullOrEmpty(Password)) { Password = string.Empty; } } } else { Password = xmlreader.GetValueAsString("radiotime", "password", string.Empty); passwordNeedsUpdate = true; } FolderId = xmlreader.GetValueAsString("radiotime", "FolderId", string.Empty); PluginName = xmlreader.GetValueAsString("radiotime", "pluginname", "RadioTime"); StartWithFastPreset = xmlreader.GetValueAsBool("radiotime", "StartWithFastPreset", false); SearchHistory.Clear(); ArtistSearchHistory.Clear(); var searchs = xmlreader.GetValueAsString("radiotime", "searchHistory", ""); if (!string.IsNullOrEmpty(searchs)) { var array = searchs.Split('|'); for (var i = 0; i < array.Length && i < 25; i++) { if (!string.IsNullOrEmpty(array[i])) { SearchHistory.Add(array[i]); } } } searchs = xmlreader.GetValueAsString("radiotime", "artistSearchHistory", ""); if (!string.IsNullOrEmpty(searchs)) { var array = searchs.Split('|'); for (var i = 0; i < array.Length && i < 25; i++) { if (!string.IsNullOrEmpty(array[i])) { ArtistSearchHistory.Add(array[i]); } } } PartnerId = "41"; } if (passwordNeedsUpdate) { SaveEncryptedPassword(); } }