38 lines
1.4 KiB
C#
38 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.Composition;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using UAF.Interfaces.Composition.Units;
|
|
using UAF.WPF.Models.Menus;
|
|
using UAF.Application.Commands;
|
|
using UAF.Interfaces.Models;
|
|
using UAF.Application;
|
|
|
|
namespace DataFileAnalyzer.Modules
|
|
{
|
|
[Export(typeof(IFrameworkMenuExtension))]
|
|
public class DataFileAnalyzerFrameworkMenuExtension : IFrameworkMenuExtension
|
|
{
|
|
event EventHandler IFrameworkMenuExtension.MenuChanged { add { } remove { } }
|
|
private MenuItemDataCollection m_menus;
|
|
|
|
public DataFileAnalyzerFrameworkMenuExtension()
|
|
{
|
|
m_menus = new MenuItemDataCollection();
|
|
MenuItemData launchAtStartMenu = new MenuItemData("Launch at Windows Startup", null, command: new LaunchAtStartCommand());
|
|
launchAtStartMenu.Data = launchAtStartMenu;
|
|
launchAtStartMenu.IsCheckable = true;
|
|
if (System.IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\Startup_" + Workspace.This.ApplicationExe.Replace(".exe", ".bat")))
|
|
launchAtStartMenu.IsChecked = true;
|
|
else
|
|
launchAtStartMenu.IsChecked = false;
|
|
m_menus.Add(launchAtStartMenu);
|
|
}
|
|
|
|
public IEnumerable<IMenuItemData> MenuDescriptions
|
|
{
|
|
get { return m_menus; }
|
|
}
|
|
}
|
|
}
|