Пример #1
0
 void AssurePlayerInit()
 {
     if (null == player)
     {
         player = PreferencesHelper.GetPlayer(Activity);
     }
 }
 void SignOut()
 {
     PreferencesHelper.SignOut(this);
     TopekaDatabaseHelper.Reset(this);
     SignInActivity.Start(this, false, null);
     FinishAfterTransition();
 }
Пример #3
0
        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);
        }
Пример #6
0
        private void SavePreferences()
        {
            if (_preferences == null)
            {
                return;
            }

            PreferencesHelper.SavePreferences(_preferences);
        }
Пример #7
0
        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();
            }
        }
Пример #8
0
        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( );
        }
Пример #9
0
		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" ) ) );
		}
Пример #10
0
        /// <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();
            }
        }
Пример #12
0
        void SetAvatarDrawable(AvatarView avatarView)
        {
            var player = PreferencesHelper.GetPlayer(Activity);

            avatarView.SetImageResource((int)player.Avatar);
        }
Пример #13
0
 void SavePlayer(Activity activity)
 {
     player = new Player(firstName.Text, lastInitial.Text, selectedAvatar);
     PreferencesHelper.WriteToPreferences(activity, player);
 }
Пример #14
0
        public ServerApplication()
        {
            PreferencesHelper.Initialize(new ServerApplicationPreferencesInfo());

            ShutdownMode = ShutdownMode.OnExplicitShutdown;
        }
Пример #15
0
 private void Application_Exit(object sender, ExitEventArgs e)
 {
     PreferencesHelper.SavePrefs("preferences.xml");
 }