private void createTaskContextMenu_OnClick(object sender, RoutedEventArgs e)
 {
     var editor = new TaskEditor();
     editor.ShowDialog();
     //написать код создания
     SaveChanges();
 }
示例#2
0
        private void CardWindowGUI(int id)
        {
            if (Event.current.type == EventType.MouseDown)
            {
                focusedCard  = id;
                cardDragRect = new Rect(id * 210f + 10f, 10, 200f, 300f);
            }

            EditorGUILayout.Space();
            boards[selectedBoard].cards[id].title = EditorGUILayout.TextField(boards[selectedBoard].cards[id].title, m_styles.centerLabel);
            EditorGUILayout.Space();

            int cardLen = boards[selectedBoard].cards.Count;
            var tasks   = boards[selectedBoard].cards[id].tasks;
            int len     = tasks.Count;

            for (int i = 0; i < len; i++)
            {
                GUILayout.BeginHorizontal();
                if (id > 0 && GUILayout.Button(EditorGUIUtility.IconContent(m_styles.proPrefix + "tab_prev@2x", "|Quick move to previous card"), m_styles.moveArrow))
                {
                    boards[selectedBoard].cards[id - 1].tasks.Add(tasks[i]);
                    tasks.RemoveAt(i);
                    i--;
                    len--;
                    continue;
                }
                GUILayout.FlexibleSpace();
                if (GUILayout.Button(tasks[i].title, m_styles.cardBox, GUILayout.Width(160), GUILayout.Height(40f)))
                {
                    TaskEditor.ShowWindow(tasks[i], boards[selectedBoard].cards[id], this);
                }
                GUILayout.FlexibleSpace();
                if (id < cardLen - 1 && GUILayout.Button(EditorGUIUtility.IconContent(m_styles.proPrefix + "tab_next@2x", "|Quick move to next card"), m_styles.moveArrow))
                {
                    boards[selectedBoard].cards[id + 1].tasks.Add(tasks[i]);
                    tasks.RemoveAt(i);
                    i--;
                    len--;
                    continue;
                }
                GUILayout.EndHorizontal();
                // if (Event.current.type == EventType.MouseUp) {

                // }
            }

            GUILayout.FlexibleSpace();
            var content = new GUIContent(EditorGUIUtility.IconContent(m_styles.proPrefix + "Toolbar Plus"));

            content.text = "Task";
            if (GUILayout.Button(content))
            {
                boards[selectedBoard].cards[id].tasks.Add(new Task());
            }
            EditorGUILayout.Space();
            GUI.DragWindow();
        }