Esempio n. 1
0
        public static string GetRepoURLFromWorkspace(WorkspaceInfo wkInfo)
        {
            if (wkInfo == null)
            {
                return(null);
            }

            WorkspaceStatusString.Data wkStatusData =
                WorkspaceStatusString.GetSelectorData(wkInfo);

            string repositoryName = wkStatusData.RepositoryName;
            string server         = wkStatusData.Server;

            if (string.IsNullOrEmpty(repositoryName) || string.IsNullOrEmpty(server))
            {
                return(null);
            }

            string orgName       = GetOrgNameFromServer(server);
            string plasticHubURL = GetPlasticHubServer(server);

            if (string.IsNullOrEmpty(orgName) || string.IsNullOrEmpty(plasticHubURL))
            {
                return(null);
            }

            return(string.Format("{0}/{1}/{2}",
                                 plasticHubURL,
                                 orgName,
                                 repositoryName));
        }
        static string GetTitle(WorkspaceInfo wkInfo)
        {
            WorkspaceStatusString.Data wkStatusData =
                WorkspaceStatusString.GetSelectorData(wkInfo);

            return(string.Format("{0} {1} @ {2} @ {3}",
                                 wkStatusData.ObjectName,
                                 wkStatusData.ObjectSpec,
                                 wkStatusData.RepositoryName,
                                 wkStatusData.Server));
        }
Esempio n. 3
0
        static void DrawWorkspaceStatus(WorkspaceStatusString.Data status)
        {
            DrawIcon(Images.Name.IconBranch);

            if (status != null)
            {
                DrawLabel(string.Format(
                              "{0}@{1}@{2}",
                              status.ObjectSpec,
                              status.RepositoryName,
                              status.Server));
            }
        }
Esempio n. 4
0
 static void DrawStatusBarLabel(WorkspaceStatusString.Data status)
 {
     GUILayout.BeginVertical();
     GUILayout.FlexibleSpace();
     if (status != null)
     {
         GUILayout.Label(
             string.Format("{0}@{1}@{2}",
                           status.ObjectSpec,
                           status.RepositoryName,
                           status.Server),
             UnityStyles.PlasticWindow.StatusBarLabel);
     }
     GUILayout.FlexibleSpace();
     GUILayout.EndVertical();
 }
Esempio n. 5
0
        void IWorkspaceWindow.UpdateTitle()
        {
            WorkspaceStatusString.Data status = null;

            IThreadWaiter waiter = ThreadWaiter.GetWaiter();

            waiter.Execute(
                /*threadOperationDelegate*/ delegate
            {
                status = GetWorkspaceStatus(mWkInfo);
            },
                /*afterOperationDelegate*/ delegate
            {
                if (waiter.Exception != null)
                {
                    return;
                }

                WorkspaceStatus = status;

                RequestRepaint();
            });
        }