public IPreferenceLooseNodeContent Clone() { KeyBindConfiguration r = new KeyBindConfiguration(); r.Import(this); return(r); }
public void OnPreferenceImport(IPreferenceFolder oldvalues, IPreferenceFolder newvalues) { _keyBind = GetKeyBindInternal(newvalues); foreach (IKeyBindChangeListener l in _keyBindChangeListener) { l.OnKeyBindChanged(_keyBind); } }
private KeyBindConfiguration GetKeyBindInternal(IPreferenceFolder folder) { Debug.Assert(folder.Id == PLUGIN_ID); IPreferenceLooseNode ln = (IPreferenceLooseNode)folder.ChildAt(_keyBindNode.Index); Debug.Assert(ln != null); KeyBindConfiguration kb = ln.Content as KeyBindConfiguration; Debug.Assert(kb != null); return(kb); }
public override void InitializePlugin(IPoderosaWorld poderosa) { base.InitializePlugin(poderosa); _instance = this; _commands = new List<IGeneralCommand>(); _idToCommand = new TypedHashtable<string, IGeneralCommand>(); _keyBind = new KeyBindConfiguration(); _keyBindChangeListener = new ListenerList<IKeyBindChangeListener>(); BasicCommandImplementation.Build(); poderosa.PluginManager.FindExtensionPoint(PreferencePlugin.EXTENSIONPOINT_NAME).RegisterExtension(this); }
public override void InitializePlugin(IPoderosaWorld poderosa) { base.InitializePlugin(poderosa); _instance = this; _commands = new List <IGeneralCommand>(); _idToCommand = new TypedHashtable <string, IGeneralCommand>(); _keyBind = new KeyBindConfiguration(); _keyBindChangeListener = new ListenerList <IKeyBindChangeListener>(); BasicCommandImplementation.Build(); poderosa.PluginManager.FindExtensionPoint(PreferencePlugin.EXTENSIONPOINT_NAME).RegisterExtension(this); }
public void Import(IKeyBinds keybinds) { _data.Clear(); _keyToTag.Clear(); _commandToTag.Clear(); KeyBindConfiguration src = (KeyBindConfiguration)keybinds; //異なるIKeyBinds実装もあるかもしれないが foreach (Tag tag in src._data) { Tag newtag = tag.Clone(); _data.Add(newtag); _commandToTag.Add(tag.Command, newtag); if (newtag.Key != Keys.None) { _keyToTag.Add(newtag.Key, newtag); } } Debug.Assert(_keyToTag.Count == src._keyToTag.Count); }
public IPreferenceLooseNodeContent Clone() { KeyBindConfiguration r = new KeyBindConfiguration(); r.Import(this); return r; }
public void OnPreferenceImport(IPreferenceFolder oldvalues, IPreferenceFolder newvalues) { _keyBind = GetKeyBindInternal(newvalues); foreach (IKeyBindChangeListener l in _keyBindChangeListener) l.OnKeyBindChanged(_keyBind); }