private void GetNames(ref string[,] MoneyValues) { string b = string.Empty; try { using (var Request = new HttpRequest()) { string SourcePage; SourcePage = Request.Get("http://www.bank.gov.ua/control/uk/curmetal/detail/currency?period=daily").ToString(); for (int i = 0; i < 25; i++) { b = string.Empty; MoneyValues[i, 0] = Convert.ToString(SourcePage.Substrings("<td class=\"cell\">", "</td>", 0)[i]); MoneyValues[i, 1] = Convert.ToString(SourcePage.Substrings("</td>\r\n\r\n <td class=\"cell_c\">", "</td>", 0)[i]); MoneyValues[i, 2] = Convert.ToString(SourcePage.Substrings("</td>\r\n <td class=\"cell_c\">", "</td>\r\n <td class=\"cell\">", 0)[i]); MoneyValues[i, 1] = MoneyValues[i, 1].Replace(".", ","); for (int l = 0; l < MoneyValues[i, 2].Length; l++) { if (Char.IsDigit(MoneyValues[i, 2][l])) { b += MoneyValues[i, 2][l]; } } if (b.Length > 0) { value_format[i] = decimal.Parse(b); } } } } catch { } }
public LastfmPreferences(LastfmSource source) { var service = ServiceManager.Get <PreferenceService> (); if (service == null) { return; } this.source = source; service.InstallWidgetAdapters += OnPreferencesServiceInstallWidgetAdapters; source_page = new Banshee.Preferences.SourcePage(source) { (account_section = new Section("lastfm-account", Catalog.GetString("Account"), 20) { (username_preference = new SchemaPreference <string> (LastfmSource.LastUserSchema, Catalog.GetString("_Username")) { ShowLabel = false }), new VoidPreference("lastfm-signup") }), (prefs_section = new Section("lastfm-settings", Catalog.GetString("Preferences"), 30)) }; scrobbler = ServiceManager.Get <Banshee.Lastfm.Audioscrobbler.AudioscrobblerService> (); if (scrobbler != null) { reporting_preference = new Preference <bool> ("enable-song-reporting", Catalog.GetString("_Enable Song Reporting"), null, scrobbler.Enabled); reporting_preference.ValueChanged += root => scrobbler.Enabled = reporting_preference.Value; prefs_section.Add(reporting_preference); } }
private void InstallPreferences() { PreferenceService service = ServiceManager.Get <PreferenceService> (); if (service == null) { return; } service.InstallWidgetAdapters += OnPreferencesServiceInstallWidgetAdapters; pref_page = new Banshee.Preferences.SourcePage("audio-cd", Catalog.GetString("Audio CDs"), "media-cdrom", 400); pref_section = pref_page.Add(new Section("audio-cd", Catalog.GetString("Audio CD Importing"), 20)); pref_section.ShowLabel = false; pref_section.Add(new VoidPreference("import-profile", Catalog.GetString("_Import format"))); pref_section.Add(new VoidPreference("import-profile-desc")); pref_section.Add(new SchemaPreference <bool> (AutoRip, Catalog.GetString("_Automatically import audio CDs when inserted"), Catalog.GetString("When an audio CD is inserted, automatically begin importing it " + "if metadata can be found and it is not already in the library."))); pref_section.Add(new SchemaPreference <bool> (EjectAfterRipped, Catalog.GetString("_Eject when done importing"), Catalog.GetString("When an audio CD has been imported, automatically eject it."))); pref_section.Add(new SchemaPreference <bool> (ErrorCorrection, Catalog.GetString("Use error correction when importing"), Catalog.GetString("Error correction tries to work around problem areas on a disc, such " + "as surface scratches, but will slow down importing substantially."))); }
// private PreferenceBase logout_pref; public StoreSourcePreferences(StoreSource source) { var service = ServiceManager.Get <PreferenceService> (); if (service == null) { return; } this.source = source; service.InstallWidgetAdapters += OnPreferencesServiceInstallWidgetAdapters; source_page = new SourcePage(source); var country_section = source_page.Add(new Section("country", Catalog.GetString("Country"), 20)); country_section.Add(country_pref = new SchemaPreference <string> (StoreCountry, null, Catalog.GetString("Which Amazon MP3 storefront to use by default."))); /*var session_section = source_page.Add (new Section ("session", Catalog.GetString ("Session"), 30)); * session_section.Add (new SchemaPreference<bool> (PersistLogin, * Catalog.GetString ("_Keep me logged in"), * Catalog.GetString ("Keep any session cookies that Amazon MP3 may set across instances."))); * session_section.Add (logout_pref = new VoidPreference ("log-out-button"));*/ Hyena.Log.InformationFormat("AmazonMP3 store redirect URL: {0}", RedirectUrl.Get()); }
private string GetNames(int Num) { string names = ""; try { using (var Request = new HttpRequest()) { string SourcePage; string[] raw; SourcePage = Request.Get("http://sibtime.ru/catalog/ruchki_pishushchie_instrumenty/?COD=ruchki_pishushchie_instrumenty&PAGEN_2=" + Num).ToString(); raw = SourcePage.Substrings("\"name\">", "</div>", 0); for (int i = 0; i < raw.Length; i++) { names += raw[i] + "\r\n"; } } } catch { } return(names); }
private bool ValidatePage(SourcePage page) { if (page.PageNumber == null || page.PageNumber < 0) { return(false); } return(true); }
public void TestIniti() { this.TestInitialize(); this.settings = new SettingsGlobalOptionsPage(this.Driver); this.loginPage = new LoginPage(this.Driver); this.loginPage.CurrentUserLogin(BaseConstants.TestCRMUrl); this.source = new SourcePage(this.Driver); Thread.Sleep(1000); this.settings.NavigateToSettings(); this.settings.NavigateToSources(); }
public CueSheetsPrefs(CueSheetsSource source) { var service = ServiceManager.Get <PreferenceService>(); if (service == null) { return; } _source = source; source_page = new SourcePage(source); }
private void UninstallPreferences() { PreferenceService service = ServiceManager.Get <PreferenceService> (); if (service == null || pref_page == null) { return; } service.InstallWidgetAdapters -= OnPreferencesServiceInstallWidgetAdapters; pref_page.Dispose(); pref_page = null; }
private void UninstallPreferences() { PreferenceService service = ServiceManager.Get <PreferenceService> (); if (service == null || pref_page == null) { return; } pref_page.Dispose(); pref_page = null; pref_section = null; }
public void Dispose() { var service = ServiceManager.Get <PreferenceService> (); if (service == null || source_page == null) { return; } service.InstallWidgetAdapters -= OnPreferencesServiceInstallWidgetAdapters; source_page.Dispose(); source_page = null; }
//Кол-во страниц private int GetCountPages() { int countPages = 0; string SourcePage; try { using (var Request = new HttpRequest()) { SourcePage = Request.Get("http://vegetarian.ru/forum/users/").ToString(); MessageBox.Show(SourcePage); countPages = Convert.ToInt32(SourcePage.Substrings("/forum/users/?PAGEN_1=", "\">", 0)[4]); } } catch {} return(countPages); }
private int GetCountPages() { int countPages = 0; try { using (var Request = new HttpRequest()) { string SourcePage; SourcePage = Request.Get("http://sibtime.ru/catalog/ruchki_pishushchie_instrumenty/").ToString(); countPages = Convert.ToInt32(SourcePage.Substrings("/catalog/ruchki_pishushchie_instrumenty/?COD=ruchki_pishushchie_instrumenty&PAGEN_2=", "\">", 0)[4]); } } catch {} return(countPages); }
private void InstallPreferences() { PreferenceService service = ServiceManager.Get <PreferenceService> (); if (service == null) { return; } service.InstallWidgetAdapters += OnPreferencesServiceInstallWidgetAdapters; pref_page = new Banshee.Preferences.SourcePage(this); pref_section = pref_page.Add(new Section("lastfm-account", Catalog.GetString("Account"), 20)); pref_section.ShowLabel = false; user_pref = new SchemaPreference <string> (LastUserSchema, Catalog.GetString("_Username")); pref_section.Add(user_pref); pref_section.Add(new VoidPreference("lastfm-signup")); }
protected override async Task ExecuteAsync(Page destination) { // Save inital values var origSrcOpacity = SourcePage.Opacity; var origDestOpacity = destination.Opacity; // Fade out source and set dest to transparent await SourcePage.FadeTo(0); destination.Opacity = 0; // Update the navigation stack await base.ExecuteAsync(destination); // Restore opacities SourcePage.Opacity = origSrcOpacity; await destination.FadeTo(origDestOpacity); }
public ActionResult PageEdit(SourcePage model) { if (!ValidatePage(model)) { ViewBag.Error = "Certains champs sont mal rempli ou incomplet, veuillez les remplirs correctements."; if (model.Id != null) { ViewBag.HeadTitle = "Edition"; } else { ViewBag.HeadTitle = "Creation"; } return(View("PageEdit", model)); } FoireMusesConnection connection = GetConnection(); try { if (model.Id == null) { model = connection.CreateSourcePage(model, new Result <SourcePage>()).Wait(); } else { SourcePage current = connection.GetSourcePage(model.Id, new Result <SourcePage>()).Wait(); if (current == null) { return(RedirectToAction("Problem", "Error", null)); } TryUpdateModel(current); model = connection.EditSourcePage(current, new Result <SourcePage>()).Wait(); } } catch (Exception e) { return(RedirectToAction("Problem", "Error", null)); } if (model == null) { return(RedirectToAction("Problem", "Error", null)); } return(View("PageDetails", model)); }
public AmpachePreferences(AmpacheSource source) { var service = ServiceManager.Get <PreferenceService> (); if (service == null) { return; } source_page = new SourcePage(source); account_section = new Section("ampache-account", "Account", 20); //account_section.Add(AmpacheSource.AmpacheRootAddress); //account_section.Add(AmpacheSource.UserName); //account_section.Add(AmpacheSource.UserPassword); source_page.Add(account_section); //account_section["ampache-account"].DisplayWidget = new PreferenceView(); var view = new PreferenceView(); source_page.DisplayWidget = view;// = new PreferenceView(); }
private void InstallPreferences() { pref_page = new Banshee.Preferences.SourcePage(PreferencesPageId, Name, "source-playlist", 500); pref_section = pref_page.Add(new Section()); pref_section.ShowLabel = false; pref_section.Add(new SchemaPreference <int> (PlayedSongsNumberSchema, Catalog.GetString("Number of _played songs to show"), null, delegate { played_songs_number = PlayedSongsNumberSchema.Get(); UpdatePlayQueue(); } )); pref_section.Add(new SchemaPreference <int> (UpcomingSongsNumberSchema, Catalog.GetString("Number of _upcoming songs to show"), null, delegate { upcoming_songs_number = UpcomingSongsNumberSchema.Get(); UpdatePlayQueue(); } )); }
public ActionResult PageEdit(string sourcePageId, string sourceId) { FoireMusesConnection connection = GetConnection(); SourcePage page = null; try { if (sourcePageId == null) { if (String.IsNullOrWhiteSpace(sourceId)) { return(RedirectToAction("Missing", "Error", null)); } else { Source source = connection.GetSource(sourceId, new Result <Source>()).Wait(); if (source == null) { return(RedirectToAction("Missing", "Error", null)); } } ViewBag.HeadTitle = "Creation"; page = new SourcePage(); page.SourceId = sourceId; } else { page = connection.GetSourcePage(sourcePageId, new Result <SourcePage>()).Wait(); if (page == null) { return(RedirectToAction("Missing", "Error", null)); } ViewBag.HeadTitle = "Edition"; } } catch (Exception e) { return(RedirectToAction("Problem", "Error", null)); } return(View(page)); }
private void InstallPreferences() { PreferenceService service = ServiceManager.Get <PreferenceService> (); if (service == null) { return; } pref_page = new Banshee.Preferences.SourcePage(this); pref_section = pref_page.Add(new Section("mediatypes", Catalog.GetString("Preferred Media Types"), 20)); pref_section.Add(new SchemaPreference <string> (AudioTypes, Catalog.GetString("_Audio"), Catalog.GetString(""))); pref_section.Add(new SchemaPreference <string> (VideoTypes, Catalog.GetString("_Video"), Catalog.GetString(""))); pref_section.Add(new SchemaPreference <string> (TextTypes, Catalog.GetString("_Text"), Catalog.GetString(""))); }
internal override async Task ExecuteInternal(object destination) { if (NativeSource == null) { if (SourcePage == null) { throw new InvalidOperationException("Source element must be on a Page"); } NativeSource = GetOrCreateRenderer(SourcePage); } try { if (Action == NavigationAction.Pop) { // Clear out our previous page on the source page to prevent stale data SourcePage?.SetPreviousPage(null); } else if (destination == null) { throw new ArgumentNullException(nameof(destination), $"May only be null for {nameof (NavigationAction.Pop)}"); } else if (destination is Page page) { page.SetPreviousPage(SourcePage); } switch (destination) { case Page page: await ExecuteAsync(page); break; case NativePage native: await ExecuteNative(native); break; default: throw new ArgumentException(); } } finally { NativeSource = null; } }
public FixSource() : base(Catalog.GetString("Metadata Fixer"), Catalog.GetString("Metadata Fixer"), -1) { TypeUniqueId = "fixes"; var header_widget = new HBox() { Spacing = 6 }; header_widget.PackStart(new Label(Catalog.GetString("Problem Type:")), false, false, 0); var combo = new Banshee.Widgets.DictionaryComboBox <Solver> (); foreach (var solver in problem_model.Solvers) { if (solver.PreferencesSection != null) { sections.Add(solver.PreferencesSection); } combo.Add(solver.Name, solver); } if (sections.Count > 0) { page = new SourcePage(this); foreach (var section in sections) { page.Add(section); } } combo.Changed += (o, a) => { problem_model.Solver = combo.ActiveValue; SetStatus(problem_model.Solver.Description, false, false, "gtk-info"); }; combo.Active = 0; var apply_button = new Hyena.Widgets.ImageButton(Catalog.GetString("Apply Selected Fixes"), "gtk-apply"); apply_button.Clicked += (o, a) => problem_model.Fix(); problem_model.Reloaded += (o, a) => apply_button.Sensitive = problem_model.SelectedCount > 0; header_widget.PackStart(combo, false, false, 0); header_widget.PackStart(apply_button, false, false, 0); header_widget.ShowAll(); Properties.SetStringList("Icon.Name", "search", "gtk-search"); Properties.SetString("ActiveSourceUIResource", "ActiveUI.xml"); Properties.SetString("GtkActionPath", "/FixSourcePopup"); Properties.Set <Gtk.Widget> ("Nereid.SourceContents.HeaderWidget", header_widget); Properties.Set <Banshee.Sources.Gui.ISourceContents> ("Nereid.SourceContents", new View(problem_model)); Properties.SetString("UnmapSourceActionLabel", Catalog.GetString("Close")); Properties.SetString("UnmapSourceActionIconName", "gtk-close"); var actions = new BansheeActionGroup("fix-source"); actions.AddImportant( new ActionEntry("RefreshProblems", Stock.Refresh, Catalog.GetString("Refresh"), null, null, (o, a) => { problem_model.Refresh(); }) ); actions.Register(); problem_model.Reload(); }
private void UninstallPreferences() { pref_page.Dispose(); pref_page = null; pref_section = null; }