public static GetBitmap ( string name ) : Bitmap | ||
name | string | /// The name of the requested bitmap. /// |
return | Bitmap |
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; } #if ModifiedForAltaxo // set/reset the Checked state of a item (a ToolStripMenuItem can not (!) show the Checked state, one has to use a ToolStripButton if (isEnabled && menuCommand != null && menuCommand is ICheckableMenuCommand) { base.Checked = ((ICheckableMenuCommand)menuCommand).IsChecked; } #endif this.Enabled = isEnabled; if (this.Visible && codon.Properties.Contains("icon")) { Image = ResourceService.GetBitmap(StringParser.Parse(codon.Properties["icon"])); } } }
public ToolBarSplitButton(Codon codon, object caller, ArrayList subItems) { this.RightToLeft = RightToLeft.Inherit; this.caller = caller; this.codon = codon; this.subItems = subItems; if (codon.Properties.Contains("label")) { Text = StringParser.Parse(codon.Properties["label"]); } if (imgButtonEnabled == null && codon.Properties.Contains("icon")) { imgButtonEnabled = ResourceService.GetBitmap(StringParser.Parse(codon.Properties["icon"])); } if (imgButtonDisabled == null && codon.Properties.Contains("disabledIcon")) { imgButtonDisabled = ResourceService.GetBitmap(StringParser.Parse(codon.Properties["disabledIcon"])); } if (imgButtonDisabled == null) { imgButtonDisabled = imgButtonEnabled; } menuCommand = codon.AddIn.CreateObject(codon.Properties["class"]) as ICommand; menuCommand.Owner = this; UpdateStatus(); UpdateText(); }
public virtual void UpdateStatus() { if (codon != null) { ConditionFailedAction failedAction = codon.GetFailedAction(caller); this.Visible = failedAction != ConditionFailedAction.Exclude; if (!isInitialized && failedAction != ConditionFailedAction.Exclude) { isInitialized = true; CreateDropDownItems(); // must be created to support shortcuts if (DropDownItems.Count == 0 && subItems.Count > 0) { DropDownItems.Add(new ToolStripMenuItem()); } } if (Image == null && codon.Properties.Contains("icon")) { try { Image = ResourceService.GetBitmap(codon.Properties["icon"]); } catch (ResourceNotFoundException) { } } } }
public virtual void UpdateStatus() { if (codon != null) { ConditionFailedAction failedAction = codon.GetFailedAction(caller); bool isVisible = failedAction != ConditionFailedAction.Exclude; if (isVisible != Visible) { Visible = isVisible; } if (menuCommand != null) { bool isChecked = menuCommand.IsChecked; if (isChecked != Checked) { Checked = isChecked; } } if (this.Visible && codon.Properties.Contains("icon")) { Image = ResourceService.GetBitmap(StringParser.Parse(codon.Properties["icon"])); } } }
public ToolBarCheckBox(Codon codon, object caller) { this.RightToLeft = RightToLeft.Inherit; this.caller = caller; this.codon = codon; try { menuCommand = (ICheckableMenuCommand)codon.AddIn.CreateObject(codon.Properties["class"]); } catch (Exception) { } if (menuCommand == null) { MessageService.ShowError("Can't create toolbar checkbox : " + codon.Id); } menuCommand.Owner = this; if (codon.Properties.Contains("label")) { Text = StringParser.Parse(codon.Properties["label"]); } if (Image == null && codon.Properties.Contains("icon")) { Image = ResourceService.GetBitmap(StringParser.Parse(codon.Properties["icon"])); } UpdateText(); UpdateStatus(); }
public virtual void UpdateStatus() { if (codon != null) { if (Image == null && codon.Properties.Contains("icon")) { Image = ResourceService.GetBitmap(codon.Properties["icon"]); } Visible = GetVisible(); } }
public virtual void UpdateStatus() { if (codon != null) { if (Image == null && codon.Properties.Contains("icon")) { try { Image = ResourceService.GetBitmap(codon.Properties["icon"]); } catch (ResourceNotFoundException) {} } Visible = GetVisible(); } }
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 = ResourceService.GetBitmap(StringParser.Parse(codon.Properties["icon"])); } } }
public ToolBarCommand(Codon codon, object caller, bool createCommand) { this.RightToLeft = RightToLeft.Inherit; this.caller = caller; this.codon = codon; if (createCommand) { menuCommand = (ICommand)codon.AddIn.CreateObject(codon.Properties["class"]); } if (codon.Properties.Contains("label")) { Text = StringParser.Parse(codon.Properties["label"]); } if (Image == null && codon.Properties.Contains("icon")) { Image = ResourceService.GetBitmap(StringParser.Parse(codon.Properties["icon"])); } UpdateStatus(); UpdateText(); }
public ToolBarDropDownButton(Codon codon, object caller, ArrayList subItems) { this.RightToLeft = RightToLeft.Inherit; this.caller = caller; this.codon = codon; this.subItems = subItems; if (codon.Properties.Contains("label")) { Text = StringParser.Parse(codon.Properties["label"]); } if (Image == null && codon.Properties.Contains("icon")) { Image = ResourceService.GetBitmap(StringParser.Parse(codon.Properties["icon"])); } if (menuBuilder == null && codon.Properties.Contains("class")) { menuBuilder = codon.AddIn.CreateObject(StringParser.Parse(codon.Properties["class"])) as ICommand; menuBuilder.Owner = this; } UpdateStatus(); UpdateText(); }