private void ParseShortCut() { if (this.codon != null && this.codon.Properties.Contains("shortcut")) { string value = StringParser.Parse(this.codon.Properties["shortcut"]); if (string.IsNullOrEmpty(value)) { return; } try { System.Windows.Forms.Shortcut shortcut = (System.Windows.Forms.Shortcut)System.Enum.Parse(typeof(System.Windows.Forms.Shortcut), value); if (shortcut != System.Windows.Forms.Shortcut.None) { this.ItemShortcut = new BarShortcut(shortcut); } } catch (System.Exception) { try { System.Windows.Forms.Keys keys = (System.Windows.Forms.Keys)System.Enum.Parse(typeof(System.Windows.Forms.Keys), value); this.ItemShortcut = new BarShortcut(keys); } catch { } } } }
private static string ShortcutToString(System.Windows.Forms.Shortcut shortcut) { if (shortcut != System.Windows.Forms.Shortcut.None) { Keys keys = (Keys)shortcut; return(TypeDescriptor.GetConverter(keys.GetType()).ConvertToString(keys)); } return(null); }
public VisualTip(string text, string title, System.Drawing.Image image, string disabledText, System.Windows.Forms.Shortcut shortcut, bool hideFooter) { Properties = new Skybound.ComponentModel.PropertyList(); Properties.PropertyChanging += new System.ComponentModel.PropertyChangedEventHandler(Properties_PropertyChanging); Properties.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Properties_PropertyChanged); Text = text; Title = title; Image = image; DisabledText = disabledText; Shortcut = shortcut; HideFooter = hideFooter; }
private void ResetAccessKey() { _AccessKey = System.Windows.Forms.Shortcut.Ins | System.Windows.Forms.Shortcut.CtrlB; }
public VisualTipProvider(System.ComponentModel.IContainer container) { _Renderer = Skybound.VisualTips.Rendering.VisualTipRenderer.DefaultRenderer; _Opacity = 0.94; _MaximumWidth = 256; _AccessKey = System.Windows.Forms.Shortcut.Ins | System.Windows.Forms.Shortcut.CtrlB; _InitialDelay = System.Windows.Forms.SystemInformation.DoubleClickTime * 2; _ReshowDelay = System.Windows.Forms.SystemInformation.DoubleClickTime; _DisplayAtMousePosition = true; VisualTipMap = new System.Collections.Hashtable(); Skybound.VisualTips.VisualTipTracker.AddHandler(InitialDelay, new System.EventHandler(OnMouseHover)); Skybound.VisualTips.VisualTipProvider.Instances.Add(this); Skybound.VisualTips.VisualTipTracker.Enable(); if (container == null) throw new System.ArgumentNullException("container"); container.Add(this); }