protected virtual void ValidateAndClose() { WitAuthUtility.ServerToken = serverToken; if (WitAuthUtility.IsServerTokenValid()) { // Create configuration int index = CreateConfiguration(serverToken); if (index != -1) { // Complete Close(); WitConfiguration c = WitConfigurationUtility.WitConfigs[index]; if (successAction == null) { WitWindowUtility.OpenConfigurationWindow(c); } else { successAction(c); } } } else { throw new ArgumentException(WitTexts.Texts.SetupSubmitFailLabel); } }
// Apply server token private void RelinkServerToken(bool closeIfInvalid) { // Open Setup if Invalid bool invalid = !WitConfigurationUtility.IsServerTokenValid(serverToken); if (invalid) { // Clear if desired if (string.IsNullOrEmpty(serverToken)) { WitAuthUtility.ServerToken = serverToken; } // Close if desired if (closeIfInvalid) { // Open Setup WitWindowUtility.OpenSetupWindow(WitWindowUtility.OpenConfigurationWindow); // Close this Window Close(); } return; } // Set valid server token WitAuthUtility.ServerToken = serverToken; WitConfigurationUtility.SetServerToken(serverToken); }
public static void OpenUnderstandingWindow() { WitWindowUtility.OpenUnderstandingWindow(); }
public static void OpenConfigurationWindow() { WitWindowUtility.OpenConfigurationWindow(); }