SPIDVerificationAPI_WPF_Sample.IsolatedStorageHelper.getInstance C# (CSharp) Method

getInstance() public static method

Creates an Instance of the storage helper
public static getInstance ( ) : IsolatedStorageHelper
return IsolatedStorageHelper
        public static IsolatedStorageHelper getInstance()
        {
            if (s_helper == null)
                s_helper = new IsolatedStorageHelper();
            return s_helper;
        }
        /// <summary>

Usage Example

示例#1
0
        /// <summary>
        /// Initialize the speaker information
        /// </summary>
        private async void initializeSpeaker()
        {
            IsolatedStorageHelper _storageHelper = IsolatedStorageHelper.getInstance();
            string _savedSpeakerId = _storageHelper.readValue(MainWindow.SPEAKER_FILENAME);

            if (_savedSpeakerId != null)
            {
                _speakerId = new Guid(_savedSpeakerId);
            }
            record.IsEnabled = false;
            if (_speakerId == Guid.Empty)
            {
                bool created = await createProfile();

                if (created)
                {
                    refreshPhrases();
                }
            }
            else
            {
                setStatus("Using profile Id: " + _speakerId.ToString());
                refreshPhrases();
                string enrollmentsStatus = _storageHelper.readValue(MainWindow.SPEAKER_ENROLLMENTS);
                if ((enrollmentsStatus != null) && (enrollmentsStatus.Equals("Done")))
                {
                    resetBtn.IsEnabled = true;
                }
            }
        }
All Usage Examples Of SPIDVerificationAPI_WPF_Sample.IsolatedStorageHelper::getInstance