Example #1
0
 private void UpdateResetCommand(GridEntry gridEntry) {
     if (totalProps > 0) {
         IMenuCommandService mcs = (IMenuCommandService)GetService(typeof(IMenuCommandService));
         if (mcs != null) {
             MenuCommand reset = mcs.FindCommand(PropertyGridCommands.Reset);
             if (reset != null) {
                 reset.Enabled = gridEntry == null ? false : gridEntry.CanResetPropertyValue();
             }
         }
     }
 }
 private void UpdateResetCommand(GridEntry gridEntry)
 {
     if (this.totalProps > 0)
     {
         IMenuCommandService service = (IMenuCommandService) this.GetService(typeof(IMenuCommandService));
         if (service != null)
         {
             MenuCommand command = service.FindCommand(PropertyGridCommands.Reset);
             if (command != null)
             {
                 command.Enabled = (gridEntry != null) && gridEntry.CanResetPropertyValue();
             }
         }
     }
 }