Exemplo n.º 1
0
        protected override void OnKeyUp(KeyEventArgs e)
        {
            // Lazy old-style keyboard shortcuts
            // ... but way shorter than this Key-/CommandBinding shananigans -.-
            base.OnKeyUp(e);
            if (e.KeyboardDevice.Modifiers == ModifierKeys.Control)
            {
                switch (e.Key)
                {
                case Key.N: File_New_Click(e.OriginalSource, null); break;

#if DEBUG
                case Key.O: _LoadProject(Settings.DEFAULT_FILE); break;
#else
                case Key.O: File_Open_Click(e.OriginalSource, null); break;
#endif

                case Key.S: File_Save_Click(e.OriginalSource, null); break;

                case Key.W: File_Close_Click(e.OriginalSource, null); break;
                }
            }
            else
            {
                //TODO: Let project view handle the rest
                if (CurrentProject != null)
                {
                    PrjView.DoKeyUp(e);
                }
            }
        }
Exemplo n.º 2
0
 protected override void OnKeyDown(KeyEventArgs e)
 {
     //TODO: Let project view handle the rest
     if (CurrentProject != null)
     {
         PrjView.DoKeyDown(e);
     }
 }
Exemplo n.º 3
0
        private void Resource_Add(object sender, RoutedEventArgs e)
        {
            string type_s = null;

            if (sender is Button)
            {
                type_s = (sender as Button).Tag as string;
            }
            else if (sender is MenuItem)
            {
                type_s = (sender as MenuItem).Tag as string;
            }
            if (type_s == null)
            {
                return;
            }

            Type type = Datatypes.Registry.Get(type_s);

            PrjView.AddResource(type);
        }
Exemplo n.º 4
0
 private void Resource_Remove(object sender, RoutedEventArgs e)
 {
     PrjView.RemoveResource();
 }