Example #1
0
        /// <summary>
        /// Set the JumpList attached property on an Application.
        /// </summary>
        public static void SetJumpList(Application application, JumpList value)
        {
            Verify.IsNotNull(application, "application");

            lock (s_lock)
            {
                // If this was associated with a different application, remove the association.
                JumpList oldValue;
                if (s_applicationMap.TryGetValue(application, out oldValue) && oldValue != null)
                {
                    oldValue._application = null;
                }

                // Associate the jumplist with the application so we can retrieve it later.
                s_applicationMap[application] = value;

                if (value != null)
                {
                    value._application = application;
                }
            }

            if (value != null)
            {
                // Changes will only get applied if the list isn't in an ISupportInitialize block.
                value.ApplyFromApplication();
            }
        }
        public static void SetJumpList(Application application, JumpList value)
        {
            Verify.IsNotNull <Application>(application, "application");
            object obj = JumpList.s_lock;

            lock (obj)
            {
                JumpList jumpList;
                if (JumpList.s_applicationMap.TryGetValue(application, out jumpList) && jumpList != null)
                {
                    jumpList._application = null;
                }
                JumpList.s_applicationMap[application] = value;
                if (value != null)
                {
                    value._application = application;
                }
            }
            if (value != null)
            {
                value.ApplyFromApplication();
            }
        }
Example #3
0
        /// <summary> 
        /// Set the JumpList attached property on an Application.
        /// </summary> 
        public static void SetJumpList(Application application, JumpList value) 
        {
            Verify.IsNotNull(application, "application"); 

            lock (s_lock)
            {
                // If this was associated with a different application, remove the association. 
                JumpList oldValue;
                if (s_applicationMap.TryGetValue(application, out oldValue) && oldValue != null) 
                { 
                    oldValue._application = null;
                } 

                // Associate the jumplist with the application so we can retrieve it later.
                s_applicationMap[application] = value;
 
                if (value != null)
                { 
                    value._application = application; 
                }
            } 

            if (value != null)
            {
                // Changes will only get applied if the list isn't in an ISupportInitialize block. 
                value.ApplyFromApplication();
            } 
        }