Exemplo n.º 1
0
        private void OnMenuOpening(object sender, EventArgs e)
        {
            App.AddLog("OnMenuOpening");

            TaskbarIcon SenderIcon = (TaskbarIcon)sender;
            string      ExeName    = Assembly.GetExecutingAssembly().Location;

            if (IsElevated)
            {
                SenderIcon.SetCheck(LoadAtStartupCommand, Scheduler.IsTaskActive(ExeName));
            }
            else
            {
                if (Scheduler.IsTaskActive(ExeName))
                {
                    SenderIcon.SetText(LoadAtStartupCommand, RemoveFromStartupHeader);
                }
                else
                {
                    SenderIcon.SetText(LoadAtStartupCommand, LoadAtStartupHeader);
                }
            }
        }