コード例 #1
0
ファイル: EditLabelCommand.cs プロジェクト: zparr/ATF
 /// <summary>
 /// Checks whether the client can do the command, if it handles it</summary>
 /// <param name="tag">Command to be done</param>
 /// <returns>True iff client can do the command</returns>
 public bool CanDoCommand(object tag)
 {
     if (tag is Commands)
     {
         var target = m_contextRegistry.GetCommandTarget <object>();
         if (target != null)
         {
             var labelEditingContext = m_contextRegistry.GetActiveContext <ILabelEditingContext>();
             return(labelEditingContext != null && labelEditingContext.CanEditLabel(target));
         }
     }
     return(false);
 }