Ejemplo n.º 1
0
        public IPreferenceLooseNodeContent Clone()
        {
            KeyBindConfiguration r = new KeyBindConfiguration();

            r.Import(this);
            return(r);
        }
Ejemplo n.º 2
0
 public void OnPreferenceImport(IPreferenceFolder oldvalues, IPreferenceFolder newvalues)
 {
     _keyBind = GetKeyBindInternal(newvalues);
     foreach (IKeyBindChangeListener l in _keyBindChangeListener)
     {
         l.OnKeyBindChanged(_keyBind);
     }
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
 public IPreferenceLooseNodeContent Clone() {
     KeyBindConfiguration r = new KeyBindConfiguration();
     r.Import(this);
     return r;
 }
Ejemplo n.º 8
0
 public void OnPreferenceImport(IPreferenceFolder oldvalues, IPreferenceFolder newvalues) {
     _keyBind = GetKeyBindInternal(newvalues);
     foreach (IKeyBindChangeListener l in _keyBindChangeListener)
         l.OnKeyBindChanged(_keyBind);
 }