コード例 #1
0
    void OnGUI()
    {
        if (m_info == null)
        {
            LoadInfo();
        }
        if (m_info == null)
        {
            m_info = new Info();
        }

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("GitHub");
        m_info.m_userNameGithub = EditorGUILayout.TextField(m_info.m_userNameGithub);
        EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("GitLab");
        m_info.m_userNameGitLab = EditorGUILayout.TextField(m_info.m_userNameGitLab);
        EditorGUILayout.EndHorizontal();
        if (GUILayout.Button("Download from servers"))
        {
            m_info.m_gitlabProjects = PublicGitLab.GetProjects(m_info.m_userNameGitLab, 5);
            m_info.m_githubProjects = PublicGitHub.GetProjects(m_info.m_userNameGithub, 5);

            RefreshCloneList();
        }
        EditorGUILayout.BeginHorizontal();

        if (GUILayout.Button("Sort by name"))
        {
            m_info.m_gitlabProjects =
                m_info.m_gitlabProjects.
                OrderBy(k => k.http_url_to_repo).ToList();

            m_info.m_githubProjects =
                m_info.m_githubProjects.
                OrderBy(k => k.clone_url).ToList();

            RefreshCloneList();
        }
        if (GUILayout.Button("Sort by created"))
        {
            m_info.m_gitlabProjects =
                m_info.m_gitlabProjects.
                OrderBy(k => k.created_at).ToList();

            m_info.m_githubProjects =
                m_info.m_githubProjects.
                OrderBy(k => k.created_at).ToList();

            RefreshCloneList();
        }
        EditorGUILayout.EndHorizontal();

        m_info.m_scrollInfo = EditorGUILayout.BeginScrollView(m_info.m_scrollInfo);
        EditorGUILayout.TextArea(m_info.m_listOfClonable);
        EditorGUILayout.EndScrollView();
    }
コード例 #2
0
 void LoadAllProjectsList_GitLab()
 {
     m_gitlabProjects = PublicGitLab.GetProjects(m_userNameGitLab, m_maxPages);
 }