Exemplo n.º 1
0
 /// <summary>
 /// This method is called when a user selects "Edit Reference Set Details" for a Lexical Relation slice.
 /// </summary>
 /// <param name="hvo"></param>
 public void EditReferenceDetails(ILexReference lr)
 {
     CheckDisposed();
     if (lr == null)
     {
         throw new ConfigurationException("Slice:GetObjectHvoForMenusToOperateOn is either messed up or should not have been called, because it could not find the object to be deleted.", m_configurationNode);
     }
     else
     {
         using (var dlg = new LexReferenceDetailsDlg(m_mediator.HelpTopicProvider))
         {
             dlg.ReferenceName    = lr.Name.AnalysisDefaultWritingSystem.Text;
             dlg.ReferenceComment = lr.Comment.AnalysisDefaultWritingSystem.Text;
             if (dlg.ShowDialog() == DialogResult.OK)
             {
                 using (UndoableUnitOfWorkHelper helper = new UndoableUnitOfWorkHelper(m_cache.ActionHandlerAccessor,
                                                                                       LexEdStrings.ksUndoEditRefSetDetails, LexEdStrings.ksRedoEditRefSetDetails))
                 {
                     lr.Name.SetAnalysisDefaultWritingSystem(dlg.ReferenceName);
                     lr.Comment.SetAnalysisDefaultWritingSystem(dlg.ReferenceComment);
                     helper.RollBack = false;
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// This method is called when a user selects "Edit Reference Set Details" for a Lexical Relation slice.
 /// </summary>
 /// <param name="hvo"></param>
 public void EditReferenceDetails(int hvo)
 {
     CheckDisposed();
     if (hvo <= 0)
     {
         throw new ConfigurationException("Slice:GetObjectHvoForMenusToOperateOn is either messed up or should not have been called, because it could not find the object to be deleted.", m_configurationNode);
     }
     else
     {
         ILexReference lr = LexReference.CreateFromDBObject(m_cache, hvo);
         using (LexReferenceDetailsDlg dlg = new LexReferenceDetailsDlg())
         {
             dlg.ReferenceName    = lr.Name.AnalysisDefaultWritingSystem;
             dlg.ReferenceComment = lr.Comment.AnalysisDefaultWritingSystem.Text;
             if (dlg.ShowDialog() == DialogResult.OK)
             {
                 lr.Name.AnalysisDefaultWritingSystem = dlg.ReferenceName;
                 lr.Comment.SetAnalysisDefaultWritingSystem(dlg.ReferenceComment);
             }
         }
     }
 }