private void PatchNoteEntry(PatchNote patchNote)
        {
            var totalWidth = GUILayoutUtility.GetLastRect().width;

            using (new HorizontalBlock(EditorStyles.helpBox))
            {
                GUILayout.Label(patchNote.dateLogged.ToString(), GUILayout.Width(120));
                //TODO Find a better way that takes into account the scroll bar if visible
                patchNote.message = EditorGUILayout.TextArea(patchNote.message, GUILayout.Width(Screen.width - 182));
                if (GUILayout.Button(_iconCog, GUILayout.Width(24)))
                {
                    var newMenu = new GenericMenu();

                    newMenu.AddItem(new GUIContent("Reset Time"), false, OnResetTimePatchNote, patchNote);

                    newMenu.AddSeparator("");

                    if (_patchNotes.patchNotes.IndexOf(patchNote) != 0)
                    {
                        newMenu.AddItem(new GUIContent("Move Up"), false, OnMoveUpPatchNote, patchNote);
                    }
                    if (_patchNotes.patchNotes.IndexOf(patchNote) != _patchNotes.patchNotes.Count - 1)
                    {
                        newMenu.AddItem(new GUIContent("Move Down"), false, OnMoveDownPatchNote, patchNote);
                    }

                    newMenu.AddSeparator("");

                    newMenu.AddItem(new GUIContent("Delete"), false, OnDeletePatchNote, patchNote);

                    newMenu.ShowAsContext();
                }
            }
        }
Beispiel #2
0
        public async Task <PatchNote> AddAsync(PatchNote patchNote)
        {
            var dbObject = await _patchNoteRepository.AddAsync(patchNote);

            var result = await _patchNoteRepository.SaveAllAsync();

            return(result ? dbObject : null);
        }
Beispiel #3
0
        public async Task <PatchNote> UpdateByIdAsync(Guid id, PatchNote patchNote)
        {
            try
            {
                var dbObject = await GetByIdAsync(id);

                dbObject.Title    = patchNote.Title;
                dbObject.Content  = patchNote.Content;
                dbObject.CommitId = patchNote.CommitId;

                await SaveAllAsync();

                return(dbObject);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(null);
            }
        }
Beispiel #4
0
 public async Task <PatchNote> UpdateByIdAsync(Guid id, PatchNote patchNote)
 {
     return(await _patchNoteRepository.UpdateByIdAsync(id, patchNote));
 }
 public async Task <IActionResult> UpdateAsync([FromRoute] Guid id, [FromBody] PatchNote patchNote)
 {
     return(Ok(await _patchNoteService.UpdateByIdAsync(id, patchNote)));
 }
        public async Task <IActionResult> AddAsync([FromBody] PatchNote patchNote)
        {
            patchNote.Author = await _userManager.GetUserAsync(User);

            return(Ok(await _patchNoteService.AddAsync(patchNote)));
        }
Beispiel #7
0
        public async Task <PatchNote> AddAsync(PatchNote patchNote)
        {
            var result = await _context.PatchNotes.AddAsync(patchNote);

            return(result.Entity);
        }