public void RegisterState <T>( string stateKey, Func <T> getterFunc, Action <T> setterAction, ApplicationStateType stateType) { AssertArg.IsNotNull(stateKey, nameof(stateKey)); AssertArg.IsNotNull(getterFunc, nameof(getterFunc)); AssertArg.IsNotNull(setterAction, nameof(setterAction)); if (stateType == ApplicationStateType.Persistent) { lock (persistentStateLock) { persistentState[stateKey] = new Accessor <T>(getterFunc, setterAction); } } else { lock (transientStateLock) { transientState[stateKey] = new Accessor <T>(getterFunc, setterAction); } } }
/// <summary> /// Initializes a new instance of the <see cref="ApplicationMeta"/> class. /// </summary> /// <param name="applicationId">The application id.</param> /// <param name="applicationStateType">Type of the application state.</param> /// <param name="dateCreated">The date created.</param> /// <param name="optStatusType">Type of the opt status.</param> public ApplicationMeta(Guid applicationId, ApplicationStateType applicationStateType, DateTime dateCreated, OptStatusType optStatusType) { this.Id = applicationId; this.State = applicationStateType; this.DateCreated = dateCreated; this.OptStatus = optStatusType; }
void Awake() { // allows this instance to behave like a singleton instance = this; ApplicationState = ApplicationStateType.IdleState; textToSpeech = gameObject.AddComponent <TextToSpeech>(); textToSpeech.Voice = TextToSpeechVoice.Mark; }
/// <summary> /// Initializes a new instance of the <see cref="ApplicationMeta"/> class. /// </summary> /// <param name="applicationId">The application id.</param> /// <param name="applicationStateType">Type of the application state.</param> /// <param name="dateCreated">The date created.</param> public ApplicationMeta(Guid applicationId, ApplicationStateType applicationStateType, DateTime dateCreated, Guid sessionId, String version, bool upgraded, OptStatusType optStatus) { this.Id = applicationId; this.State = applicationStateType; this.DateCreated = dateCreated; this.OptStatus = optStatus; this.Version = version; this.Upgraded = upgraded; this.SessionId = sessionId; }
public void OnVoiceCommand(string command) { Debug.Log(command); switch (command) { case "Bot": if (ApplicationState != ApplicationStateType.BotState) { SceneAnimatorController.SetTrigger("ChatbotState"); BotDirectLineManager.Initialize(DirectLineKey); BotDirectLineManager.Instance.BotResponse += OnBotResponse; BotDirectLineManager.Instance.StartConversationAsync().Wait(); } ApplicationState = ApplicationStateType.BotState; break; case "Vision": if (ApplicationState != ApplicationStateType.VisionState) { SceneAnimatorController.SetTrigger("IronVisionState"); ApplicationState = ApplicationStateType.VisionState; } break; case "STT": if (applicationState == ApplicationStateType.BotState) { PhraseRecognitionSystem.Shutdown(); dictationRecognizer = new DictationRecognizer(); dictationRecognizer.DictationResult += DictationRecognizer_DictationResult; dictationRecognizer.DictationHypothesis += DictationRecognizer_DictationHypothesis; dictationRecognizer.DictationComplete += DictationRecognizer_DictationComplete; dictationRecognizer.DictationError += DictationRecognizer_DictationError; dictationRecognizer.Start(); } break; default: Debug.LogError("No Reconocido el comando"); break; } }
private static void ChangeView(ApplicationStateType value) { switch (value) { case ApplicationStateType.IdleState: break; case ApplicationStateType.BotState: break; case ApplicationStateType.VisionState: break; } }
public void RegisterStatefulProperty <T>( string stateKey, Func <T> propertyGetter, Action <T> propertySetter, ApplicationStateType applicationStateType) { if (!StatePreservationEnabled) { throw new InvalidOperationException( "StatePreservationEnabled must be set to true " + "to register a stateful property."); } EnsureStateAttributesRead(); viewState.RegisterState( stateKey, propertyGetter, propertySetter, applicationStateType); }
void InitializeApplicationBar(ApplicationStateType applicationBarState) { this.ApplicationBar.Buttons.Remove(_startButton); this.ApplicationBar.Buttons.Remove(_pauseButton); this.ApplicationBar.Buttons.Remove(_stopButton); this.ApplicationBar.Buttons.Remove(_statisticsButton); this.ApplicationBar.Buttons.Remove(_settingsButton); switch (applicationBarState) { case ApplicationStateType.NotReady: _startButton.IsEnabled = false; this.ApplicationBar.Buttons.Add(_startButton); this.ApplicationBar.Buttons.Add(_settingsButton); break; case ApplicationStateType.Ready: _startButton.IsEnabled = true; this.ApplicationBar.Buttons.Add(_startButton); this.ApplicationBar.Buttons.Add(_settingsButton); break; case ApplicationStateType.Running: this.ApplicationBar.Buttons.Add(_pauseButton); this.ApplicationBar.Buttons.Add(_stopButton); break; case ApplicationStateType.Paused: _startButton.IsEnabled = true; this.ApplicationBar.Buttons.Add(_startButton); this.ApplicationBar.Buttons.Add(_stopButton); break; case ApplicationStateType.Completed: _startButton.IsEnabled = true; this.ApplicationBar.Buttons.Add(_startButton); this.ApplicationBar.Buttons.Add(_statisticsButton); this.ApplicationBar.Buttons.Add(_settingsButton); break; } }
public void ResumeRun() { using (var isoStore = IsolatedStorageFile.GetUserStoreForApplication()) { if (isoStore.FileExists(appStateFileName)) { using (BinaryReader br = new BinaryReader(new IsolatedStorageFileStream(appStateFileName, FileMode.Open, isoStore))) { _initialApplicationState = (ApplicationStateType)(br.ReadInt32()); CurrentRun.LoadRunDetail(br); br.Close(); } isoStore.DeleteFile(appStateFileName); } } }
internal static extern int GetProcessState(SafeStatsHandle info, out ApplicationStateType state);
public StatePropertyInfo(PropertyInfo info, ApplicationStateType stateType) { PropertyInfo = info; PersistenceType = stateType; }
public StatefulAttribute(ApplicationStateType stateType) { StateType = stateType; }
public async Task <ReviewTestResult> ReviewRPTest(int applicationId, string note, ApplicationStateType stateType) { if (!await rolesService.IsPermitted(httpContextReader.CurrentUserId, Constants.AdminsAndSupportersRoles)) { throw new NoPermissionsException(ErrorMessages.NotAllowedMessage); } var application = await database.ApplicationRepository.GetApplicationWithApplicant(applicationId) ?? throw new EntityNotFoundException("Application not found"); bool isSucceeded; using (var transaction = database.BeginTransaction().Transaction) { application.SetReviewDetails(httpContextReader.CurrentUserId, note, stateType); application.Applicant.SetAppState(stateType == ApplicationStateType.Passed ? AppStateType.Accepted : AppStateType.TestPassed); isSucceeded = await database.ApplicationRepository.Update(application) && await database.UserRepository.Update(application.Applicant); transaction.Complete(); } return(isSucceeded ? new ReviewTestResult(isSucceeded, application.ApplicantId) : throw new DatabaseException()); }