internal static void JoinCloudServer( string cloudServer, string username, string accessToken) { SaveCloudServer.ToPlasticGuiConfig(cloudServer); SaveCloudServer.ToPlasticGuiConfigFile( cloudServer, GetPlasticConfigFileToSaveOrganization()); SaveCloudServer.ToPlasticGuiConfigFile( cloudServer, GetGluonConfigFileToSaveOrganization()); KnownServers.ServersFromCloud.InitializeForWindows( PlasticGuiConfig.Get().Configuration.DefaultCloudServer); CloudEditionWelcome.WriteToTokensConf( cloudServer, username, accessToken); if (sAutoLogin) { ClientConfigData clientConfigData = ConfigurationChecker.GetClientConfigData(); clientConfigData.WorkspaceServer = cloudServer; clientConfigData.WorkingMode = SEIDWorkingMode.SSOWorkingMode.ToString(); clientConfigData.SecurityConfig = username; ClientConfig.Get().Save(clientConfigData); GetWindow <PlasticWindow>().GetWelcomeView().autoLoginState = AutoLogin.State.OrganizationChoosed; } }
internal static void Initialize() { if (mInitialized) { return; } ConfigureLogging(); RegisterExceptionHandlers(); InitLocalization(); ThreadWaiter.Initialize(new UnityThreadWaiterBuilder()); ServicePointConfigurator.ConfigureServicePoint(); CertificateUi.RegisterHandler(new ChannelCertificateUiImpl()); DisableFsWatcherIfNeeded(); EditionManager.Get().DisableCapability( EnumEditionCapabilities.Extensions); ClientHandlers.Register(); PlasticGuiConfig.SetConfigFile( PlasticGuiConfig.UNITY_GUI_CONFIG_FILE); mInitialized = true; }
internal static string ToCreateWorkspace(IPlasticWebRestApi plasticWebRestApi) { string clientConfServer = PlasticGui.Plastic.ConfigAPI.GetClientConfServer(); if (!EditionToken.IsCloudEdition()) { return(clientConfServer); } string cloudServer = PlasticGuiConfig.Get(). Configuration.DefaultCloudServer; if (!string.IsNullOrEmpty(cloudServer)) { return(cloudServer); } CloudEditionCreds.Data config = CloudEditionCreds.GetFromClientConf(); cloudServer = GetFirstCloudServer. GetCloudServer(plasticWebRestApi, config.Email, config.Password); if (string.IsNullOrEmpty(cloudServer)) { return(clientConfServer); } SaveCloudServer.ToPlasticGuiConfig(cloudServer); return(cloudServer); }
internal static string ToCreateWorkspace() { string clientConfServer = Plastic.ConfigAPI.GetClientConfServer(); if (!EditionToken.IsCloudEdition()) { return(clientConfServer); } string organizationName = PlasticGuiConfig.Get(). Configuration.CloudOrganization; if (!string.IsNullOrEmpty(organizationName)) { return(GetCloudServer(organizationName)); } CloudEditionCreds.Data config = CloudEditionCreds.GetFromClientConf(); organizationName = CloudOrganizationRetriever. GetOrganization(config.Email, config.Password); if (string.IsNullOrEmpty(organizationName)) { return(clientConfServer); } SaveCloudOrganization.ToPlasticGuiConfig(organizationName); return(GetCloudServer(organizationName)); }
internal static void InitializeIfNeeded() { if (sIsInitialized) { return; } sIsInitialized = true; PlasticAPI = new PlasticAPI(); PlasticWebRestApi = new PlasticWebRestApi(); ConfigureLogging(); GuiMessage.Initialize(new UnityPlasticGuiMessage()); RegisterExceptionHandlers(); InitLocalization(); ThreadWaiter.Initialize(new UnityThreadWaiterBuilder()); ServicePointConfigurator.ConfigureServicePoint(); CertificateUi.RegisterHandler(new ChannelCertificateUiImpl()); SetupFsWatcher(); EditionManager.Get().DisableCapability( EnumEditionCapabilities.Extensions); ClientHandlers.Register(); PlasticGuiConfig.SetConfigFile( PlasticGuiConfig.UNITY_GUI_CONFIG_FILE); sEventSenderScheduler = EventTracking.Configure( PlasticApp.PlasticWebRestApi, AssetsPath.IsRunningAsUPMPackage() ? ApplicationIdentifier.UnityPackage : ApplicationIdentifier.UnityAssetStorePlugin, IdentifyEventPlatform.Get()); if (sEventSenderScheduler != null) { sPingEventLoop = new PingEventLoop(); sPingEventLoop.Start(); sPingEventLoop.SetUnityVersion(Application.unityVersion); CollabPlugin.GetVersion(pluginVersion => sPingEventLoop.SetPluginVersion(pluginVersion)); } PlasticMethodExceptionHandling.InitializeAskCredentialsUi( new CredentialsUiImpl()); ClientEncryptionServiceProvider.SetEncryptionPasswordProvider( new MissingEncryptionPasswordPromptHandler()); }
void OnEnable() { if (mException != null) { return; } GuiMessage.Initialize(new UnityPlasticGuiMessage(this)); ConfigureLogging(); RegisterExceptionHandlers(); RegisterApplicationFocusHandlers(this); InitLocalization(); ThreadWaiter.Initialize(new UnityThreadWaiterBuilder()); ServicePointConfigurator.ConfigureServicePoint(); CertificateUi.RegisterHandler(new ChannelCertificateUiImpl()); CredentialsUIRegistrar.RegisterCredentialsUI( new CredentialsUiImpl(this)); ClientEncryptionServiceProvider.SetEncryptionPasswordProvider( new MissingEncryptionPasswordPromptHandler(this)); DisableFsWatcherIfNeeded(); EditionManager.Get().DisableCapability( EnumEditionCapabilities.Extensions); mPlasticAPI = new PlasticAPI(); ClientHandlers.Register(); PlasticGuiConfig.SetConfigFile(PLASTIC_GUI_CONFIG_FILE); mPingEventLoop = new PingEventLoop(); mEventSenderRestApi = new SimpleEventSenderRestApi( PlasticWebApiUris.GetBaseUri()); mEventSenderScheduler = EventTracking.Configure( mEventSenderRestApi, ApplicationIdentifier.UnityPackage, IdentifyEventPlatform.Get()); if (mEventSenderScheduler != null) { mPingEventLoop.Start(); } InitializePlastic(); }
static WorkspaceInfo CreateWorkspace( RepositorySpec repositorySpec, string projectPath) { CreateWorkspaceDialogUserAssistant assistant = new CreateWorkspaceDialogUserAssistant( PlasticGuiConfig.Get().Configuration.DefaultWorkspaceRoot, Plastic.API.GetAllWorkspacesArray()); assistant.RepositoryChanged( repositorySpec.ToString(), string.Empty, string.Empty); return(Plastic.API.CreateWorkspace( projectPath, assistant.GetProposedWorkspaceName(), repositorySpec.ToString())); }
internal static void JoinOrganization(string organization, string username, string accessToken) { SaveCloudServer.ToPlasticGuiConfig(organization); SaveCloudServer.ToPlasticGuiConfigFile( organization, GetPlasticConfigFileToSaveOrganization()); SaveCloudServer.ToPlasticGuiConfigFile( organization, GetGluonConfigFileToSaveOrganization()); KnownServers.ServersFromCloud.InitializeForWindows( PlasticGuiConfig.Get().Configuration.DefaultCloudServer); CloudEditionWelcome.WriteToTokensConf( organization, username, accessToken); ClientConfigData clientConfigData = ClientConfig.Get().GetClientConfigData(); clientConfigData.WorkspaceServer = organization; ClientConfig.Get().Save(clientConfigData); }
internal void AutoRefresh() { if (mIsAutoRefreshDisabled) { return; } if (!PlasticGuiConfig.Get().Configuration.CommitAutoRefresh) { return; } if (mPlasticClient.IsRefreshing() || mPlasticClient.IsOperationInProgress()) { return; } if (mNewChangesInWk != null && !mNewChangesInWk.Detected()) { return; } ((IRefreshableView)this).Refresh(); }