예제 #1
0
        private void CompleteBt_Clicked(object sender, EventArgs e)
        {
            string title       = TitleEntry.Text;
            string description = DescriptionEntry.Text;

            if (title == null || title == "")
            {
                TitleEntry.TextColor = Color.Accent;
            }
            else if (_purpose == EditPurpose.createNew && _localData.GetGroups().Any(u => u.Title == title))
            {
                TitleEntry.TextColor = Color.Accent;
            }
            else if (description == null || description == "")
            {
                TitleEntry.TextColor       = Color.DarkCyan;
                DescriptionEntry.TextColor = Color.Accent;
            }
            else
            {
                TitleEntry.TextColor       = Color.DarkCyan;
                DescriptionEntry.TextColor = Color.DarkCyan;

                Group group = new Group(0, title, description, link);

                if (_purpose == EditPurpose.createNew)
                {
                    _localData.AddNewGroup(group);
                    group.Id = _localData.GetGroups().Find(u => u.Title == group.Title).Id;
                }
                else if (_purpose is EditPurpose.edit)
                {
                    _localData.UpdateGroup(_oldGroup, group);
                    group.Id = _localData.GetGroups().Find(u => u.Title == group.Title).Id;
                }

                EditorResult();
            }
        }
예제 #2
0
        private void RequestForGroup(GroupRequestDialog.RequestPurpose purpose)
        {
            var dialog = _renderer.GetGroupRequestDialog(purpose, _localData.GetGroups());

            dialog.SetTheme(_themes.CurrentTheme);
            mainPageGrid.SetSingleChild(dialog);

            if (!_definedDialogs.Contains(DialogSet.GroupRequestDialog))
            {
                dialog.RequestCompleted       += GroupRequestCompleted;
                dialog.ShowGroupsViewRequest  += SetGroupsView;
                dialog.ShowGroupEditorRequest += SetGroupEditor;

                _definedDialogs.Add(DialogSet.GroupRequestDialog);
            }
        }