예제 #1
0
        public virtual void UpdateStatus()
        {
            if (codon != null)
            {
                ConditionFailedAction failedAction = codon.GetFailedAction(caller);
                this.Visible = failedAction != ConditionFailedAction.Exclude;
                bool isEnabled = failedAction != ConditionFailedAction.Disable;
                if (isEnabled && menuCommand != null && menuCommand is IMenuCommand)
                {
                    isEnabled = ((IMenuCommand)menuCommand).IsEnabled;
                }
                this.Enabled = isEnabled;

                if (this.Visible && codon.Properties.Contains("icon"))
                {
                    Image = WinFormsResourceService.GetBitmap(StringParser.Parse(codon.Properties["icon"]));
                }
            }
        }
예제 #2
0
 public virtual void UpdateStatus()
 {
     if (codon != null)
     {
         ConditionFailedAction failedAction = codon.GetFailedAction(caller);
         this.Visible = failedAction != ConditionFailedAction.Exclude;
         if (menuCommand == null && !string.IsNullOrEmpty(codon.Properties["checked"]))
         {
             Checked = string.Equals(StringParser.Parse(codon.Properties["checked"]),
                                     bool.TrueString, StringComparison.OrdinalIgnoreCase);
         }
         else
         {
             CreateMenuCommand();
             if (menuCommand != null)
             {
                 Checked = menuCommand.IsChecked;
             }
         }
     }
 }
예제 #3
0
 public bool UseRegistryForProject(IProject project)
 {
     return(codon.GetFailedAction(project) == ConditionFailedAction.Nothing);
 }