private static void CancelAcceptButtons(DocBrowser browser, MemberEditor editor) { if (GUILayout.Button("Cancel", EditorStyles.toolbarButton)) { browser.ShowMatchList = false; } EditorGUI.BeginDisabledGroup(editor == null || editor.m_OrphanDocItem == editor.m_Item || editor.m_OrphanDocItem == null); if (GUILayout.Button("Save Match", EditorStyles.toolbarButton)) { editor.Save(); } EditorGUI.EndDisabledGroup(); }
void OnGUI() { if (s_Styles == null) { s_Styles = new Styles(); } ToolbarGUI(); EditorGUILayout.BeginHorizontal(); { if (m_ShowList && m_List != null) { m_List.OnGUI(); GUILayout.Space(styles.dividerSpace); } if (ShowMatchList) { m_MatchList.OnGUI(); GUILayout.Space(styles.dividerSpace); } EditorGUILayout.BeginVertical(); { if (m_Editor != null) { m_Editor.OnGUI(); } else { MemberEditor.NoEditorGUI(this); } } EditorGUILayout.EndVertical(); } EditorGUILayout.EndHorizontal(); if (m_FirstLoad > 0 && Event.current.type == EventType.Repaint) { m_FirstLoad--; if (m_FirstLoad == 0) { LoadMembers(); } Repaint(); } }
private void OnSelectMember(MemberList list, string memberName) { if (ShowMatchList) { UpdateMatch(); return; } MemberItem item = list.GetSelectedMemberSlow(); if (item == null) { return; } m_Editor = new MemberEditor(this, item); }
private void UpdateMatch() { MemberItem docItem = m_List.GetSelectedMemberSlow(); MemberItem asmItem = m_MatchList.GetSelectedMemberSlow(); if (docItem == null) { m_Editor = null; return; } if (asmItem == null) { m_Editor = new MemberEditor(this, docItem); return; } m_Editor = new MemberEditor(this, docItem, asmItem); }
void OnEnable() { // Code below is executed both when the window is opened and at mono reloads. LoadMembers(m_FirstLoad > 0); if (string.IsNullOrEmpty(m_List.selectedMemberName)) { m_Editor = null; } if (m_Editor != null) { m_Editor.OnEnable(m_List.GetSelectedMemberSlow()); } if (m_List != null) { m_List.SetCallbacks(MaySelectNewMember, OnSelectMember); } if (m_MatchList != null) { m_MatchList.SetCallbacks(MaySelectNewMatch, OnSelectMatch); } }