static TestApplicationJumpListService CreateTestService(TestNativeJumpList nativeJumpList, out TestJumpActionsManager jumpActionsManager)
        {
            jumpActionsManager = new TestJumpActionsManager();
            var applicationJumpListService = new TestApplicationJumpListService(nativeJumpList, jumpActionsManager);

            applicationJumpListService.Items.Clear();
            return(applicationJumpListService);
        }
 protected override void SetUpCore()
 {
     base.SetUpCore();
     ApplicationJumpListServiceTestsImageSourceHelper.RegisterPackScheme();
     NativeResourceManager.CompanyNameOverride = "DevExpress Tests Long Path Test Long Path Test Long Path Test Long Path Test";
     NativeResourceManager.ProductNameOverride = "DevExpress.Xpf.Core Tests Long Path Test Long Path Test Long Path Test";
     NativeResourceManager.VersionOverride     = AssemblyInfo.Version;
     nativeJumpList             = new TestNativeJumpList();
     applicationJumpListService = applicationJumpListServiceInstance = CreateTestService(nativeJumpList, out jumpActionsManager);
 }
 protected override void SetUpCore() {
     base.SetUpCore();
     ApplicationJumpListServiceTestsImageSourceHelper.RegisterPackScheme();
     NativeResourceManager.CompanyNameOverride = "DevExpress Tests";
     NativeResourceManager.ProductNameOverride = "DevExpress.Xpf.Core Tests";
     nativeJumpList = new TestNativeJumpList();
     jumpActionsManager = new TestJumpActionsManager();
     applicationJumpListService = new TestApplicationJumpListService(nativeJumpList, jumpActionsManager);
     Assert.IsNotNull(applicationJumpListService);
     applicationJumpListService.Items.Clear();
 }
예제 #4
0
 protected override void SetUpCore()
 {
     base.SetUpCore();
     ApplicationJumpListServiceTestsImageSourceHelper.RegisterPackScheme();
     NativeResourceManager.CompanyNameOverride = "DevExpress Tests Long Path Test Long Path Test Long Path Test Long Path Test";
     NativeResourceManager.ProductNameOverride = "DevExpress.Xpf.Core Tests Long Path Test Long Path Test Long Path Test";
     NativeResourceManager.VersionOverride     = AssemblyInfo.Version;
     nativeJumpList             = new TestNativeJumpList();
     jumpActionsManager         = new TestJumpActionsManager();
     applicationJumpListService = new TestApplicationJumpListService(nativeJumpList, jumpActionsManager);
     Assert.IsNotNull(applicationJumpListService);
     applicationJumpListService.Items.Clear();
 }
 public void DisableAutomaticallyApplyItemsOnAttachingIfNoAnyItems()
 {
     foreach (var automaticallyApplyItemsOnAttaching in new[] { true, false })
     {
         int           executeCounter = 0;
         var           nativeJumpList = new TestNativeJumpList();
         Func <Action> app            = () => {
             var ui = new Button();
             TestJumpActionsManager jumpActionsManager;
             var service = CreateTestService(nativeJumpList, out jumpActionsManager);
             if (automaticallyApplyItemsOnAttaching)
             {
                 service.Items.Add(new ApplicationJumpPath()
                 {
                     Path = "123"
                 });
             }
             Interaction.GetBehaviors(ui).Add(service);
             IApplicationJumpListService i = service;
             Action apply = () => {
                 i.Items.Add(new ApplicationJumpTaskInfo()
                 {
                     Title = "Execute", Action = () => ++ executeCounter
                 });
                 i.Apply();
             };
             return(apply);
         };
         var initialCount = automaticallyApplyItemsOnAttaching ? 1 : 0;
         var process1     = app();
         Assert.AreEqual(initialCount, nativeJumpList.AppliedList.JumpItems.Count);
         process1();
         Assert.AreEqual(initialCount + 1, nativeJumpList.AppliedList.JumpItems.Count);
         var process2 = app();
         Assert.AreEqual(automaticallyApplyItemsOnAttaching ? initialCount : initialCount + 1, nativeJumpList.AppliedList.JumpItems.Count);
         process2();
         Assert.AreEqual(initialCount + 1, nativeJumpList.AppliedList.JumpItems.Count);
     }
 }