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;
            }
        }
Пример #2
0
            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);
            }
Пример #3
0
            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));
            }
        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()));
        }
Пример #5
0
        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);
        }
Пример #6
0
        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();
        }