public void EditTaskState(int stateID)
        {
            State state = (State)TaskManager.GetTaskState(stateID);

            if (state == null)
            {
                return;
            }
            ViewSingleStateDialog stateView = GuiFactory.CreateSingleStateView(MainForm, state);

            if (Gtk.ResponseType.Ok == (Gtk.ResponseType)stateView.ShowDialog())
            {
                state.Name = stateView.Name;

                state.ColorRed   = stateView.ColorRed;
                state.ColorGreen = stateView.ColorGreen;
                state.ColorBlue  = stateView.ColorBlue;

                state.Save();
                ControledGui.Source = TaskManager.TaskStateSource;
                ControledGui.BindStates();
                if (autosave)
                {
                    StorageManager.Save();
                }
            }
        }
        public void CreateTaskState()
        {
            ViewSingleStateDialog stateView = GuiFactory.CreateSingleStateView(MainForm);

            if (Gtk.ResponseType.Ok == (Gtk.ResponseType)stateView.ShowDialog())
            {
                State newState = (State)StateFactory.CreateTaskState();
                if (newState == null)
                {
                    return;
                }
                newState.Name = stateView.Name;

                newState.ColorRed   = stateView.ColorRed;
                newState.ColorGreen = stateView.ColorGreen;
                newState.ColorBlue  = stateView.ColorBlue;

                newState.Save();
                ControledGui.Source = TaskManager.TaskStateSource;
                ControledGui.BindStates();
                if (autosave)
                {
                    StorageManager.Save();
                }
            }
        }