示例#1
0
 private void MenuItem_MouseLeave_HandleItem(LauncherMenuItem item)
 {
     /*switch (item.ItemType)
      * {
      *  case LauncherMenuItemType.Mod:
      *      break;
      * }*/
 }
示例#2
0
        private void MenuItem_MouseDown(object sender, MouseButtonEventArgs e)
        {
            LauncherMenuItem item = (sender as FrameworkElement)?.DataContext as LauncherMenuItem;

            if (item == null)
            {
                return;
            }
            MenuItem_MouseDown_HandleItem(item);
        }
        private void MenuItem_MouseLeave(object sender, MouseEventArgs e)
        {
            LauncherMenuItem item = (sender as FrameworkElement)?.DataContext as LauncherMenuItem;

            if (item == null)
            {
                return;
            }
            MenuItem_MouseLeave_Event.Invoke(item);
        }
示例#4
0
        private void MenuItem_MouseEnter_HandleItem(LauncherMenuItem item)
        {
            switch (item.ItemType)
            {
            case LauncherMenuItemType.Mod:
                SetLogo(item.Logo);
                SetBackground(item.Background);
                break;

            //case LauncherMenuItemType.About:
            //    SetLogo(null);
            //    SetBackground(null);
            //    break;
            default:
                SetLogo(null);
                SetBackground(null);
                break;
            }
        }
示例#5
0
        private void MenuItem_MouseDown_HandleItem(LauncherMenuItem item)
        {
            switch (item.ItemType)
            {
            case LauncherMenuItemType.Exit:
                Close();
                break;

            case LauncherMenuItemType.Mod:
                LaunchMod(item.Filename);
                break;

            case LauncherMenuItemType.Mods:
                if (mode == Mode.Mods)
                {
                    SetInfo(null);
                    mode = Mode.Default;
                }
                else
                {
                    SetInfo(MoreModsPanel);
                    mode = Mode.Mods;
                }
                break;

            case LauncherMenuItemType.Options:
                if (mode == Mode.Options)
                {
                    SetInfo(null);
                    mode = Mode.Default;
                }
                else
                {
                    SetInfo(OptionsPanel);
                    mode = Mode.Options;
                }
                break;

            case LauncherMenuItemType.Update:
                if (mode == Mode.Update)
                {
                    SetInfo(null);
                    mode = Mode.Default;
                }
                else
                {
                    SetInfo(new FrameworkElement());
                    mode = Mode.Update;
                }
                break;

            case LauncherMenuItemType.About:
                if (mode == Mode.About)
                {
                    SetInfo(null);
                    mode = Mode.Default;
                }
                else
                {
                    TextBlock block = new TextBlock();
                    block.Padding      = new Thickness(5);
                    block.Text         = File.ReadAllText("about.txt");
                    block.TextWrapping = TextWrapping.Wrap;
                    SetInfo(block);
                    mode = Mode.About;
                }
                break;
            }
        }