internal static void IfRepositoryIsEmpty( WorkspaceInfo wkInfo, string repository, bool isGluonWorkspace, IPlasticAPI plasticApi, IProgressControls progressControls, ICreateWorkspaceListener createWorkspaceListener, PlasticWindow plasticWindow) { RepositoryInfo repInfo = null; bool isEmptyRepository = false; progressControls.ShowProgress(string.Empty); IThreadWaiter waiter = ThreadWaiter.GetWaiter(10); waiter.Execute( /*threadOperationDelegate*/ delegate { RepositorySpec repSpec = new SpecGenerator(). GenRepositorySpec(false, repository); repInfo = plasticApi.GetRepositoryInfo(repSpec); isEmptyRepository = IsEmptyRepositoryCondition. Evaluate(wkInfo, repSpec, plasticApi); }, /*afterOperationDelegate*/ delegate { progressControls.HideProgress(); if (waiter.Exception != null) { DisplayException(progressControls, waiter.Exception); return; } if (!SetupCloudProjectId.HasCloudProjectId()) { SetupCloudProjectId.ForRepository(repInfo); } if (!isEmptyRepository) { plasticWindow.RefreshWorkspaceUI(); AssetMenu.AssetMenuItems.Enable(); return; } CheckinPackagesAndProjectSettingsFolders( wkInfo, isGluonWorkspace, plasticApi, progressControls, createWorkspaceListener); }); }
internal CreateWorkspaceView( EditorWindow parentWindow, ICreateWorkspaceListener listener, PlasticAPI plasticApi) { mParentWindow = parentWindow; mCreateWorkspaceListener = listener; mProgressControls = new ProgressControlsForViews(); mWorkspaceOperations = new WorkspaceOperations(this, mProgressControls); mCreateWorkspaceState = CreateWorkspaceViewState.BuildForProjectDefaults(); Initialize(plasticApi); }
internal CreateWorkspaceView( PlasticWindow parentWindow, ICreateWorkspaceListener listener, PlasticAPI plasticApi, IPlasticWebRestApi plasticWebRestApi, string workspacePath) { mParentWindow = parentWindow; mCreateWorkspaceListener = listener; mWorkspacePath = workspacePath; mPlasticWebRestApi = plasticWebRestApi; mProgressControls = new ProgressControlsForViews(); mWorkspaceOperations = new WorkspaceOperations(this, mProgressControls); mCreateWorkspaceState = CreateWorkspaceViewState.BuildForProjectDefaults(); Initialize(plasticApi, plasticWebRestApi); }
static void CheckinPackagesAndProjectSettingsFolders( WorkspaceInfo wkInfo, bool isGluonWorkspace, IPlasticAPI plasticApi, IProgressControls progressControls, ICreateWorkspaceListener createWorkspaceListener) { List <string> paths = new List <string> { Path.Combine(wkInfo.ClientPath, "Packages"), Path.Combine(wkInfo.ClientPath, "ProjectSettings") }; string comment = PlasticLocalization.GetString( PlasticLocalization.Name.UnityInitialCheckinComment); progressControls.ShowProgress(PlasticLocalization.GetString( PlasticLocalization.Name.UnityInitialCheckinProgress)); IThreadWaiter waiter = ThreadWaiter.GetWaiter(10); waiter.Execute( /*threadOperationDelegate*/ delegate { PerformAdd(paths, plasticApi); PerformCheckinForMode( wkInfo, paths, comment, isGluonWorkspace); }, /*afterOperationDelegate*/ delegate { progressControls.HideProgress(); if (waiter.Exception != null && !IsMergeNeededException(waiter.Exception)) { DisplayException(progressControls, waiter.Exception); return; } createWorkspaceListener.OnWorkspaceCreated( wkInfo, isGluonWorkspace); }); }