private void UpdateCurrentValue() { // Get our configuration inputs Data.PrebuiltConfigData.InputRow[] inputRows = prebuiltConfigControl.SelectedConfiguration.GetInputRows(); int inputIndex = pageIndex - 1; if (inputIndex >= 0 && inputIndex < inputRows.Length) { Data.PrebuiltConfigData.InputRow inputRow = inputRows[inputIndex]; if (inputRow.Type == "Text") { inputRow.Value = txtTextValue.Text; } else if (inputRow.Type == "Greeting") { if (greetingValues.ContainsKey(inputRow.Name)) { greetingControl.SaveGreeting(WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.GreetingsSoundCache), greetingValues[inputRow.Name]); } } } }
private void UpdatePage(bool moveForward) { greetingControl.StopSounds(); UpdateCurrentValue(); if (moveForward) { pageIndex++; } else { pageIndex--; } if (pageIndex == 0) { btnBack.Enabled = false; } else { btnBack.Enabled = true; } btnNext.Text = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.PrebuiltConfigForm_Next); if (pageIndex == 0) { wizMain.PageIndex = 0; } else { // Get our configuration inputs Data.PrebuiltConfigData.InputRow[] inputRows = prebuiltConfigControl.SelectedConfiguration.GetInputRows(); int inputIndex = pageIndex - 1; if (inputIndex >= 0 && inputIndex < inputRows.Length) { Data.PrebuiltConfigData.InputRow inputRow = inputRows[inputIndex]; if (inputRow.Display) { if (inputRow.Type == "Text") { wizMain.PageIndex = 1; lblTextTitle.Text = inputRow.Title; lblTextDescription.Text = inputRow.Description; lblTextDisplayName.Text = inputRow.DisplayName; txtTextValue.Text = inputRow.Value; txtTextValue.Select(); } else if (inputRow.Type == "Greeting") { lblGreetingTitle.Text = inputRow.Title; lblGreetingDescription.Text = inputRow.Description; greetingControl.SuggestedText = inputRow.DisplayName; if (!greetingValues.ContainsKey(inputRow.Name)) { greetingValues[inputRow.Name] = cbDataset.LocalizedGreetings.NewLocalizedGreetingsRow(); greetingValues[inputRow.Name].GreetingID = new Guid(inputRow.Value); greetingValues[inputRow.Name].LocalizedGreetingID = Guid.NewGuid(); greetingValues[inputRow.Name].LanguageID = ManagementInterfaceClient.ManagementInterface.GetDefaultLanguage(ManagementInterfaceClient.AuthInfo); greetingValues[inputRow.Name].Type = (short)WOSI.CallButler.Data.GreetingType.SoundGreeting; } greetingControl.LoadGreeting(greetingValues[inputRow.Name], WOSI.Utilities.FileUtils.GetApplicationRelativePath(Properties.Settings.Default.GreetingsSoundCache)); wizMain.PageIndex = 2; } } else { UpdatePage(moveForward); } } else if (pageIndex != 0) { btnNext.Text = CallButler.Manager.Utils.PrivateLabelUtils.ReplaceProductName(Properties.LocalizedStrings.PrebuiltConfigForm_Finish); wizMain.PageIndex = 3; } } }