CredentialsUIImpl.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using UnityEditor;
  2. using Codice.Client.Common;
  3. using Codice.Client.Common.Connection;
  4. using PlasticGui;
  5. using Unity.PlasticSCM.Editor.UI;
  6. namespace Unity.PlasticSCM.Editor.Configuration
  7. {
  8. internal class CredentialsUiImpl : AskCredentialsToUser.IGui
  9. {
  10. internal CredentialsUiImpl(EditorWindow parentWindow)
  11. {
  12. mParentWindow = parentWindow;
  13. }
  14. AskCredentialsToUser.DialogData AskCredentialsToUser.IGui.AskUserForCredentials(string servername)
  15. {
  16. AskCredentialsToUser.DialogData result = null;
  17. GUIActionRunner.RunGUIAction(delegate
  18. {
  19. result = CredentialsDialog.RequestCredentials(
  20. servername, mParentWindow);
  21. });
  22. return result;
  23. }
  24. void AskCredentialsToUser.IGui.ShowSaveProfileErrorMessage(string message)
  25. {
  26. GUIActionRunner.RunGUIAction(delegate
  27. {
  28. GuiMessage.ShowError(string.Format(
  29. PlasticLocalization.GetString(
  30. PlasticLocalization.Name.CredentialsErrorSavingProfile),
  31. message));
  32. });
  33. }
  34. AskCredentialsToUser.DialogData AskCredentialsToUser.IGui.AskUserForSSOCredentials(string cloudServer)
  35. {
  36. AskCredentialsToUser.DialogData result = null;
  37. GUIActionRunner.RunGUIAction(delegate
  38. {
  39. result = SSOCredentialsDialog.RequestCredentials(
  40. cloudServer, mParentWindow);
  41. });
  42. return result;
  43. }
  44. EditorWindow mParentWindow;
  45. }
  46. }