예제 #1
0
        /// <summary>
        /// Creates a new custom category instance
        /// </summary>
        /// <param name="categoryName">Category name</param>
        public JumpListCustomCategory(string categoryName)
        {
            Name = categoryName;

            JumpListItems = new JumpListItemCollection <IJumpListItem>();
            JumpListItems.CollectionChanged += OnJumpListCollectionChanged;
        }
예제 #2
0
        /// <summary>
        /// Adds user tasks to the Taskbar JumpList. User tasks can only consist of JumpListTask or
        /// JumpListSeparator objects.
        /// </summary>
        /// <param name="tasks">The user tasks to add to the JumpList.</param>
        public void AddUserTasks(params JumpListTask[] tasks)
        {
            if (userTasks == null)
            {
                // Make sure that we don't create multiple instances
                // of this object
                lock (syncLock) {
                    if (userTasks == null)
                    {
                        userTasks = new JumpListItemCollection <JumpListTask>();
                    }
                }
            }

            if (tasks != null)
            {
                foreach (JumpListTask task in tasks)
                {
                    userTasks.Add(task);
                }
            }
        }