コード例 #1
0
        public IActionResult UpdateLive(string id, LiveDocument liveDocument)
        {
            if (!ExistLive(id))
            {
                return(NotFound());
            }

            _liveService.Update(id, liveDocument);

            return(NoContent());
        }
コード例 #2
0
        /// <summary>
        /// Resolves a hyperlink to a treenode in the document map
        /// </summary>
        /// <param name="sender">The source of the event</param>
        /// <param name="e">The event arguments</param>
        public static void Resolve(object sender, System.Windows.RoutedEventArgs e)
        {
            if (e.Source is System.Windows.Documents.Hyperlink)
            {
                System.Windows.Documents.Hyperlink sourceLink = e.Source as System.Windows.Documents.Hyperlink;
                LiveDocument document = LiveDocumentorFile.Singleton.LiveDocument;
                Entry        entry    = null;
                sourceLink.Cursor = Cursors.Wait;

                EntryKey key = null;
                if (sourceLink.Tag is CrefEntryKey)
                {
                    CrefEntryKey crefEntryKey = (CrefEntryKey)sourceLink.Tag;
                    CRefPath     path         = CRefPath.Parse(crefEntryKey.CRef);
                    entry = document.Find(path);
                }
                else if (sourceLink.Tag is EntryKey)
                {
                    key = (EntryKey)sourceLink.Tag;
                    if (key != null)
                    {
                        entry = document.Find(key.Key, key.SubKey);

                        if (entry != null && entry.Parent != null)
                        {
                            entry.IsSelected        = true;
                            entry.Parent.IsExpanded = true;
                        }
                    }
                }

                if (entry != null && entry.Parent != null)
                {
                    entry.IsSelected        = true;
                    entry.Parent.IsExpanded = true;
                }

                sourceLink.Cursor = null;
            }
        }
コード例 #3
0
        public ActionResult <LiveDocument> CreateLive(LiveDocument liveDocument)
        {
            _liveService.Save(liveDocument);

            return(CreatedAtRoute(nameof(GetLivesById), new { id = liveDocument.Id.ToString() }, liveDocument));
        }
コード例 #4
0
        public void Update(string id, LiveDocument liveDocument)
        {
            liveDocument.Id = id;

            _liveRepository.Update(id, liveDocument);
        }
コード例 #5
0
 public void Save(LiveDocument liveDocument)
 {
     _liveRepository.Create(liveDocument);
 }
コード例 #6
0
 public void Update(string id, LiveDocument liveDocument)
 {
     _lives.ReplaceOne(live => live.Id == id, liveDocument);
 }
コード例 #7
0
 public void Create(LiveDocument liveDocument)
 {
     _lives.InsertOne(liveDocument);
 }