Пример #1
0
        /// <summary>
        /// Creates a single task bar instance.
        /// </summary>
        /// <returns></returns>
        public static TaskBar Create(Window mainWindow, string appId, params JumpListTask[] tasks)
        {
            if (Current == null)
            {
                if (TaskbarManager.IsPlatformSupported)
                {
                    Current = new TaskBar(mainWindow, appId);
                    Current.AddTasks(tasks);
                }
                else
                {
                    Current = new UnsupportedTaskBar();
                }
            }

            return(Current);
        }
Пример #2
0
 private void InitializeTaskBar(Window window)
 {
     string systemFolder        = Environment.GetFolderPath(Environment.SpecialFolder.System);
     string applicationFilePath = Assembly.GetExecutingAssembly().Location;
     var    taskBar             = TaskBar.Create(window, Settings.Default.AppId, new JumpListLink[]
     {
         new JumpListLink(applicationFilePath, Microsoft.FamilyShow.Properties.Resources.StartANewFamilyTree)
         {
             Arguments     = "/n",
             IconReference = new IconReference(Path.Combine(systemFolder, "shell32.dll"), 0),
         },
         new JumpListLink(applicationFilePath, Microsoft.FamilyShow.Properties.Resources.OpenMenu)
         {
             Arguments     = "/o",
             IconReference = new IconReference(Path.Combine(systemFolder, "shell32.dll"), 4),
         },
         new JumpListLink(applicationFilePath, Microsoft.FamilyShow.Properties.Resources.GedcomMenu)
         {
             Arguments     = "/i",
             IconReference = new IconReference(Path.Combine(systemFolder, "shell32.dll"), 4),
         }
     });
 }