public NavCategoryInitializer( ViewMode mode, int id, string name, string nameKey, string glyph, CategoryGroupType group, MyVirtualKey vKey, bool categorySupportsNegative) { this.viewMode = mode; this.serializationId = id; this.friendlyName = name; this.nameResourceKey = nameKey; this.glyph = glyph; this.groupType = group; this.virtualKey = vKey; this.supportsNegative = categorySupportsNegative; }
private static void OnVirtualKeyPropertyChanged(DependencyObject target, MyVirtualKey oldValue, MyVirtualKey newValue) { // Writer lock for the static maps lock (s_keyboardShortcutMapLockMutex) { var button = ((ButtonBase)target); int viewId = Utilities.GetWindowId(); // Check if the View Id has already been registered if (s_virtualKey.TryGetValue(viewId, out var iterViewMap)) { Insert(iterViewMap, newValue, new WeakReference(button)); } else { // If the View Id is not already registered, then register it and make the entry s_virtualKey.Add(viewId, new SortedDictionary <MyVirtualKey, List <WeakReference> >()); Insert(s_virtualKey[viewId], newValue, new WeakReference(button)); } } }
private static void OnVirtualKeyControlChordPropertyChanged(DependencyObject target, MyVirtualKey oldValue, MyVirtualKey newValue) { // Writer lock for the static maps lock (s_keyboardShortcutMapLockMutex) { Control control = (target as ButtonBase); if (control == null) { // Handling Ctrl+E shortcut for Date Calc, target would be NavigationView^ in that case control = (target as MUXC.NavigationView); } int viewId = Utilities.GetWindowId(); // Check if the View Id has already been registered if (s_VirtualKeyControlChordsForButtons.TryGetValue(viewId, out var iterViewMap)) { Insert(iterViewMap, newValue, new WeakReference(control)); } else { // If the View Id is not already registered, then register it and make the entry s_VirtualKeyControlChordsForButtons.Add(viewId, new SortedDictionary <MyVirtualKey, List <WeakReference> >()); Insert(s_VirtualKeyControlChordsForButtons[viewId], newValue, new WeakReference(control)); } } }
public static void SetVirtualKeyControlShiftChord(DependencyObject target, MyVirtualKey value) { target.SetValue(VirtualKeyControlShiftChordProperty, value); }
public static void SetVirtualKey(DependencyObject target, MyVirtualKey value) { target.SetValue(VirtualKeyProperty, value); }
public static void SetVirtualKeyControlInverseChord(DependencyObject obj, MyVirtualKey value) => obj.SetValue(VirtualKeyControlInverseChordProperty, value);
public static void SetVirtualKeyShiftChord(DependencyObject obj, MyVirtualKey value) => obj.SetValue(VirtualKeyShiftChordProperty, value);
ViewMode GetViewModeForVirtualKey(MyVirtualKey virtualKey) { var iter = s_categoryManifest.FirstOrDefault(initializer => initializer.Value.virtualKey == virtualKey); return((iter != null) ? iter.Value.viewMode : ViewMode.None); }