void AssurePlayerInit() { if (null == player) { player = PreferencesHelper.GetPlayer(Activity); } }
void SignOut() { PreferencesHelper.SignOut(this); TopekaDatabaseHelper.Reset(this); SignInActivity.Start(this, false, null); FinishAfterTransition(); }
private void LoadPreferences() { _preferences = PreferencesHelper.GetPreferences(); var direction = _preferences.RightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight; ToggleDirection(direction); ReloadRecentFileMenuItems(); }
protected override void OnStop() { base.OnStop(); if (PreferencesHelper.IsSignedIn(this)) { Finish(); } }
private void SetupQueryParameters(Guid?tokenOverride = null) { Guid token = tokenOverride ?? PreferencesHelper.GetAuthenticationToken(this) ?? Guid.Empty; Guid requestIdentifier = Guid.NewGuid( ); string deviceIdentifier = Settings.Secure.GetString(ContentResolver, Settings.Secure.AndroidId); string checkSum = CryptoHelper.GenerateApiSignedHash(requestIdentifier, deviceIdentifier, CoreConfig.TestConsumerSecret); QueryParameters.SetupBaseQueryParameters(token.ToString( ), requestIdentifier.ToString( ), deviceIdentifier, checkSum); }
private void SavePreferences() { if (_preferences == null) { return; } PreferencesHelper.SavePreferences(_preferences); }
private void Application_Startup(object sender, StartupEventArgs e) { PreferencesHelper.LoadPrefs("preferences.xml"); var ffmpegNotFound = string.IsNullOrWhiteSpace(PreferencesHelper.ffmpegPath); var ffprobeNotFound = string.IsNullOrWhiteSpace(PreferencesHelper.ffprobePath); var ffplayNotFound = string.IsNullOrWhiteSpace(PreferencesHelper.ffplayPath); if (ffmpegNotFound || ffprobeNotFound || ffplayNotFound) { FirstTimeSetup.AutoSetupFFMpeg(); } }
protected override void OnCreate(Bundle savedInstanceState) { QueryParameters = new ContactsQueryParameters(LeaseId); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.contacts_activity); PreferencesHelper.SetInstanceUrl(this, "http://192.168.108.219:57204/"); PreferencesHelper.SetAuthenticationToken(this, new Guid("476F624F-2238-4041-AC31-C78F4E1DE869")); FindViews( ); SetupViews( ); }
public override void OnCreate( ) { base.OnCreate( ); PreferencesHelper.SetIsAuthenticated( ApplicationContext, true ); PreferencesHelper.SetInstanceUrl( ApplicationContext, "http://192.168.108.219:57204/" ); string instanceUrl = PreferencesHelper.GetIsAuthenticated( ApplicationContext ) ? PreferencesHelper.GetInstanceUrl( ApplicationContext ) : "todo"; string consumerKey = CoreConfig.TestConsumerKey.ToString( ); Container = new UnityContainer( ); Container.RegisterInstance( RestService.For<IApi>( ApiHelper.GetHttpClient( instanceUrl, consumerKey ) ) ); Container.RegisterType<IContactsDataSource, ContactsApiDataSource>( "ContactsRemoteDataSource" ); Container.RegisterType<IGetContactsCallback, ContactsViewCallback>( ); Container.RegisterType<IContactsDataSource, ContactsRepository>( new InjectionConstructor( new ResolvedParameter<IContactsDataSource>( "ContactsRemoteDataSource" ) ) ); }
/// <summary> /// Opens a dialog to allow the user to select the FFMpeg executable. Saves the path /// to the executable to the TextBox and to an application-scope variable. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Select_FFMpeg(object sender, RoutedEventArgs e) { Debug.WriteLine("\"Select FFMpeg executable\" button clicked."); var findFFMpegDialog = new OpenFileDialog(); findFFMpegDialog.Title = "Select ffmpeg.exe"; findFFMpegDialog.DefaultExt = ".exe"; findFFMpegDialog.Filter = "Executables (.exe) | *.exe"; if (findFFMpegDialog.ShowDialog() == true) { var pathToFFMpeg = findFFMpegDialog.FileName; FFMpeg_Location.Text = pathToFFMpeg; string pathToFFProbe = Modify_Path(pathToFFMpeg, "ffprobe.exe"); string pathToFFPlay = Modify_Path(pathToFFMpeg, "ffplay.exe"); PreferencesHelper.setFFMpegLocations(pathToFFMpeg, pathToFFProbe, pathToFFPlay); } }
private static void Main() { try { DefaultLoggingConfiguration.Setup(); // Custom splash screen ApplicationSplashScreen splashScreen = null; if (IsOnlyInstance()) { var windowsSplashScreen = new SplashScreen("Resources/SplashScreen.png"); splashScreen = new ApplicationSplashScreen(windowsSplashScreen); splashScreen.Show(); } var startupInfo = new CustomControlsExamples.CustomApplicationStartupInfo(splashScreen); PreferencesHelper.Initialize(startupInfo.ApplicationInfo); ShellApplication.RunStandalone(startupInfo); } finally { DefaultLoggingConfiguration.Cleanup(); } }
void SetAvatarDrawable(AvatarView avatarView) { var player = PreferencesHelper.GetPlayer(Activity); avatarView.SetImageResource((int)player.Avatar); }
void SavePlayer(Activity activity) { player = new Player(firstName.Text, lastInitial.Text, selectedAvatar); PreferencesHelper.WriteToPreferences(activity, player); }
public ServerApplication() { PreferencesHelper.Initialize(new ServerApplicationPreferencesInfo()); ShutdownMode = ShutdownMode.OnExplicitShutdown; }
private void Application_Exit(object sender, ExitEventArgs e) { PreferencesHelper.SavePrefs("preferences.xml"); }