Esempio n. 1
0
            public KeyboardMappingManager(NiCommandManager commandManager)
            {
                _commandManager = commandManager;

                _registryKey = ((NiEnv)commandManager.GetService(typeof(INiEnv))).RegistryRoot + "\\KeyboardMappings";

                LoadInitialKeys();
                LoadMappings();
            }
Esempio n. 2
0
        public MenuBuilder(INiPackage package, string niMenu, Dictionary<string, object> resources)
        {
            if (package == null)
                throw new ArgumentNullException("package");
            if (niMenu == null)
                throw new ArgumentNullException("niMenu");
            if (resources == null)
                throw new ArgumentNullException("resources");

            _commandManager = (NiCommandManager)package.GetService(typeof(INiCommandManager));
            _menuManager = (INiMenuManager)package.GetService(typeof(INiMenuManager));
            _package = package;
            _niMenu = niMenu;
            _resources = resources;
        }
Esempio n. 3
0
        public MenuBuilder(INiPackage package, string niMenu, Dictionary <string, object> resources)
        {
            if (package == null)
            {
                throw new ArgumentNullException("package");
            }
            if (niMenu == null)
            {
                throw new ArgumentNullException("niMenu");
            }
            if (resources == null)
            {
                throw new ArgumentNullException("resources");
            }

            _commandManager = (NiCommandManager)package.GetService(typeof(INiCommandManager));
            _menuManager    = (INiMenuManager)package.GetService(typeof(INiMenuManager));
            _package        = package;
            _niMenu         = niMenu;
            _resources      = resources;
        }
Esempio n. 4
0
                public NiKeyboardMappings(NiCommandManager commandManager)
                {
                    _keyboardMappingManager = commandManager._keyboardMappingManager;

                    Mappings = new Dictionary <Guid, Keys[]>(
                        _keyboardMappingManager.LoadFromRegistry()
                        );

                    // Seed the mappings with mappings from the command manager.

                    foreach (var item in _keyboardMappingManager._initialKeys)
                    {
                        var keys = new List <Keys>();

                        Keys[] loadedKeys;
                        if (Mappings.TryGetValue(item.Key, out loadedKeys))
                        {
                            keys.AddRange(loadedKeys);
                        }
                        else if (item.Value != 0)
                        {
                            keys.Add(item.Value);
                        }

                        _mappingsByButton.Add(item.Key, keys);

                        foreach (var key in keys)
                        {
                            List <Guid> buttons;
                            if (!_mappingsByKeys.TryGetValue(key, out buttons))
                            {
                                buttons = new List <Guid>();
                                _mappingsByKeys.Add(key, buttons);
                            }

                            buttons.Add(item.Key);
                        }
                    }
                }
Esempio n. 5
0
 public NiMenuManager(IServiceProvider serviceProvider)
     : base(serviceProvider)
 {
     _mainForm = ((NiEnv)GetService(typeof(INiEnv))).MainForm;
     _commandManager = (NiCommandManager)GetService(typeof(INiCommandManager));
 }
Esempio n. 6
0
 public ShortcutMessageFilter(NiCommandManager commandManager)
 {
     _commandManager = commandManager;
 }
            public KeyboardMappingManager(NiCommandManager commandManager)
            {
                _commandManager = commandManager;

                _registryKey = ((NiEnv)commandManager.GetService(typeof(INiEnv))).RegistryRoot + "\\KeyboardMappings";

                LoadInitialKeys();
                LoadMappings();
            }
                public NiKeyboardMappings(NiCommandManager commandManager)
                {
                    _keyboardMappingManager = commandManager._keyboardMappingManager;

                    Mappings = new Dictionary<Guid, Keys[]>(
                        _keyboardMappingManager.LoadFromRegistry()
                    );

                    // Seed the mappings with mappings from the command manager.

                    foreach (var item in _keyboardMappingManager._initialKeys)
                    {
                        var keys = new List<Keys>();

                        Keys[] loadedKeys;
                        if (Mappings.TryGetValue(item.Key, out loadedKeys))
                            keys.AddRange(loadedKeys);
                        else if (item.Value != 0)
                            keys.Add(item.Value);

                        _mappingsByButton.Add(item.Key, keys);

                        foreach (var key in keys)
                        {
                            List<Guid> buttons;
                            if (!_mappingsByKeys.TryGetValue(key, out buttons))
                            {
                                buttons = new List<Guid>();
                                _mappingsByKeys.Add(key, buttons);
                            }

                            buttons.Add(item.Key);
                        }
                    }
                }
Esempio n. 9
0
 public ShortcutMessageFilter(NiCommandManager commandManager)
 {
     _commandManager = commandManager;
 }