示例#1
0
        void RegisterJumpList()
        {
            IApplicationJumpListService jumpListService = this.GetService <IApplicationJumpListService>();

            jumpListService.Items.AddOrReplace("NewEmployee", GetJumpListIcon("icon-new-employee-16"), () => SignleObjectDocumentManagerService.ShowNewEntityDocument <Employee>(this));
            jumpListService.Items.AddOrReplace("Customers", GetJumpListIcon("Modules/icon-nav-customers-32"), () => Show(Modules.Where(m => m.DocumentType == "CustomerCollectionView").First()));
            jumpListService.Items.AddOrReplace("Opportunities", GetJumpListIcon("Modules/icon-nav-opportunities-32"), () => Show(Modules.Where(m => m.DocumentType == "QuoteCollectionView").First()));
            jumpListService.Apply();
        }
 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);
 }
        void RegisterJumpList()
        {
#if !CLICKONCE && !DXCORE3
            IApplicationJumpListService jumpListService = this.GetService <IApplicationJumpListService>();
            jumpListService.Items.AddOrReplace("Modules", "New Employee", EmployeeIcon, () => { SignleObjectDocumentManagerService.ShowNewEntityDocument <Employee>(this); });
            jumpListService.Items.AddOrReplace("Modules", "Customers", CustomerIcon, () => { Show(Modules.Where(m => m.DocumentType == "CustomerCollectionView").First()); });
            jumpListService.Items.AddOrReplace("Modules", "Opportunities", OpportunitiesIcon, () => { Show(Modules.Where(m => m.DocumentType == "QuoteCollectionView").First()); });
            jumpListService.Apply();
#endif
        }
        void RegisterJumpList()
        {
#if !CLICKONCE && !DXCORE3
            IApplicationJumpListService jumpListService = this.GetService <IApplicationJumpListService>();
            jumpListService.Items.AddOrReplace("Become a UI Superhero", "Explore DevExpress Universal", UniversalIcon, () => { LinksViewModel.UniversalSubscription(); });
            jumpListService.Items.AddOrReplace("Online Tutorials", "Explore DevExpress Universal", TutorialsIcon, () => { LinksViewModel.GettingStarted(); });
            jumpListService.Items.AddOrReplace("Buy Now", "Explore DevExpress Universal", BuyIcon, () => { LinksViewModel.BuyNow(); });
            jumpListService.Apply();
#endif
        }
 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();
 }
示例#6
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);
     }
 }