Esempio n. 1
0
        void RaiseActiveProfileChanged(IShortcutProfileManager shortcutProfileManager, ShortcutProfile oldActiveProfile, ShortcutProfile newActiveProfile)
        {
            var oldActiveProfileId = oldActiveProfile?.id ?? ShortcutManager.defaultProfileId;
            var newActiveProfileId = newActiveProfile?.id ?? ShortcutManager.defaultProfileId;
            var eventArgs          = new ActiveProfileChangedEventArgs(oldActiveProfileId, newActiveProfileId);

            activeProfileChanged?.Invoke(eventArgs);
        }
Esempio n. 2
0
        internal ShortcutManagerImplementation(IShortcutProfileManager profileManager)
        {
            m_ShortcutProfileManager = profileManager;

            // TODO: Not sure if these events mean the same
            m_ShortcutProfileManager.activeProfileChanged   += RaiseActiveProfileChanged;
            m_ShortcutProfileManager.shortcutBindingChanged += RaiseShortcutBindingChanged;
        }
Esempio n. 3
0
        public ShortcutManagerWindowViewController(SerializedShortcutManagerWindowState state, IDirectory directory, IBindingValidator bindingValidator, IShortcutProfileManager profileManager, IContextManager contextManager, IAvailableShortcutsChangedNotifier availableShortcutsChangedNotifier)
        {
            m_SerializedState        = state;
            m_ShortcutProfileManager = profileManager;
            m_Directory        = directory;
            m_ContextManager   = contextManager;
            m_BindingValidator = bindingValidator;
            m_AvailableShortcutsChangedNotifier = availableShortcutsChangedNotifier;

            InitializeCategoryList();
            BuildKeyMapBindingStateData();
            PopulateShortcutsBoundToSelectedKey();
        }
 internal void Initialize(IShortcutProfileManager sender)
 {
     directory = new Directory(profileManager.GetAllShortcuts());
     m_Trigger = new Trigger(directory, new ConflictResolver());
 }
Esempio n. 5
0
 void OnLoadedProfilesChanged(IShortcutProfileManager shortcutProfileManager)
 {
     m_ShortcutManagerWindowView.RefreshProfiles();
 }
Esempio n. 6
0
 void OnActiveProfileChanged(IShortcutProfileManager shortcutProfileManager, ShortcutProfile previousActiveProfile, ShortcutProfile currentActiveProfile)
 {
     UpdateInternalCache();
 }
 void OnActiveProfileChanged(IShortcutProfileManager sender, ShortcutProfile oldActiveProfile, ShortcutProfile newActiveProfile)
 {
     m_LastUsedProfileIdProvider.lastUsedProfileId = profileManager.activeProfile?.id;
     Initialize();
 }
 void OnShortcutBindingChanged(IShortcutProfileManager sender, Identifier identifier, ShortcutBinding oldBinding, ShortcutBinding newBinding)
 {
     Initialize();
 }
Esempio n. 9
0
        void RaiseShortcutBindingChanged(IShortcutProfileManager shortcutProfileManager, Identifier identifier, ShortcutBinding oldBinding, ShortcutBinding newBinding)
        {
            var eventArgs = new ShortcutBindingChangedEventArgs(identifier.path, oldBinding, newBinding);

            shortcutBindingChanged?.Invoke(eventArgs);
        }
 public ShortcutController(IDiscovery discovery)
 {
     profileManager = new ShortcutProfileManager(discovery.GetAllShortcuts());
     profileManager.shortcutsModified += Initialize;
     profileManager.ApplyActiveProfile();
 }
 public ConflictResolver(IShortcutProfileManager profileManager, IContextManager contextManager, IConflictResolverView conflictResolverView)
 {
     m_ProfileManager       = profileManager;
     m_ContextManager       = contextManager;
     m_ConflictResolverView = conflictResolverView;
 }