Esempio n. 1
0
        public void Navigate(IExplorerBarItem explorerBarItem)
        {
            var navigationList = explorerBarItem.GetAccessorsList();

            this.NavigationList = navigationList.Select(item => new ContextCommand(item.Caption, () => item.IsSelected = true))
                                  .ToArray();
        }
Esempio n. 2
0
 private void Init(IExplorerBarItem innerItem)
 {
     _innerItem          = innerItem;
     this.IsSelected     = _innerItem.IsSelected;
     this.IsChecked      = _innerItem.IsChecked;
     this.AllowItemCheck = _innerItem.AllowItemCheck;
 }
Esempio n. 3
0
        private void DoLazyLoad()
        {
            _lazyLoadIndicator.Do(indicator =>
            {
                indicator.IsLoading = true;
                _lazyLoadIndicator  = Optional <LazyLoadingIndicatorExplorerBarItem> .None();

                StartBusyAction(() =>
                {
                    var appServices = this.ServiceLocator.GetInstance <IApplicationServices>();

                    IEnumerable <IExplorerBarItem> items = new IExplorerBarItem[0];
                    try
                    {
                        items = GetLazyLoadedItems();
                    }
                    finally
                    {
                        appServices.ExecuteOnUIThread(() =>
                        {
                            indicator.IsLoading = false;
                            this.Items.Remove(indicator);
                        });
                    }

                    appServices.ExecuteOnUIThread(() =>
                    {
                        foreach (var item in items)
                        {
                            this.Items.Add(item);
                        }
                    });
                });
            });
        }
Esempio n. 4
0
 public GamePartTreeItem(string gameName, TViewModel viewModel, IExplorerBarItem parent, IServiceLocator serviceLocator)
     : base(parent, serviceLocator)
 {
     GameName            = gameName;
     ViewModel           = viewModel;
     this.AllowItemCheck = false;
 }
Esempio n. 5
0
 public GameEngineTreeItem(IGameEngineViewModel gameEngine, IExplorerBarItem parent, IServiceLocator serviceLocator, Optional <IComponentRenameDeleteHandler> renamingService)
     : base(gameEngine, parent, serviceLocator, renamingService)
 {
     foreach (var game in gameEngine.Games.OrderBy(g => g.Name))
     {
         this.Items.Add(new GameTreeItem(game, this, serviceLocator, renamingService));
     }
 }
Esempio n. 6
0
 public GameEnginePublisherTreeViewItem(IGameEnginePublisherViewModel publisher,
                                        IExplorerBarItem parent,
                                        IServiceLocator serviceLocator)
     : base(publisher, parent, serviceLocator)
 {
     foreach (var game in publisher.Games)
     {
         this.Items.Add(new GamePublisherTreeViewItem(game, this, serviceLocator));
     }
 }
Esempio n. 7
0
        public ProductionBranchExplorerBarItem(IProductionBranch productionBranch, IExplorerBarItem parent, IServiceLocator serviceLocator)
            : base(parent, serviceLocator)
        {
            _productionBranch = productionBranch;

            foreach (var env in _productionBranch.GetEnvironments())
            {
                this.Items.Add(ItemsFactory.CreateProductionEnvironment(env));
            }
        }
Esempio n. 8
0
        public EnvironmentBranchExplorerBarItem(TMainBranch mainBranch, IExplorerBarItem parent, IServiceLocator serviceLocator)
            : base(parent, serviceLocator)
        {
            this.MainBranch = mainBranch;
            Items.Add(CreateMainExplorerBarItem(mainBranch));

            LoadFeatureBranches();

            SubscribeToEvent <NewFeatureBranchEventData>(NewFeatureBranchEventHandler);
        }
Esempio n. 9
0
 public QAInstallersExplorerBarItem(IQaBranch qaBranch, IExplorerBarItem parent, IServiceLocator serviceLocator) : base(parent, serviceLocator)
 {
     _qaBranch = qaBranch;
     if (!UseLazyLoading)
     {
         foreach (var item in GetLazyLoadedItems())
         {
             this.Items.Add(item);
         }
     }
 }
Esempio n. 10
0
 public ComponentsExplorerBarItem(TComponentViewModel componentViewModel,
                                  IExplorerBarItem parent,
                                  IServiceLocator serviceLocator,
                                  Optional <IComponentRenameDeleteHandler> renameDeleteHandler)
     : base(parent, serviceLocator)
 {
     this.ComponentViewModel = componentViewModel;
     _renameDeleteHanlder    = renameDeleteHandler;
     SubscribeToEvent <ComponentRenamedEventData>(ComponentRenamedEventHandler);
     SubscribeToEvent <ComponentDeletedEventData>(ComponentDeletedEventHandler);
 }
Esempio n. 11
0
        public GameTreeItem(IGameViewModel game, IExplorerBarItem parent, IServiceLocator serviceLocator, Optional <IComponentRenameDeleteHandler> renameHandler)
            : base(game, parent, serviceLocator, renameHandler)
        {
            game.Math.Do(math =>
            {
                this.Items.Add(new GameMathTreeItem(game.Name, math, this, serviceLocator));
            });

            game.Limits.Do(limits =>
            {
                this.Items.Add(new GameLimitsTreeItem(game.Name, limits, this, serviceLocator));
            });
        }
Esempio n. 12
0
        public ExplorerBarItem(IExplorerBarItem parent, IServiceLocator serviceLocator)
            : base(serviceLocator)
        {
            if (parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }

            this.Parent = Optional <IExplorerBarItem> .Some(parent);

            _explorerBar = () => parent.ExplorerBar;
            InitLazyLoading();
        }
Esempio n. 13
0
        private void InitDependencies()
        {
            _qaBranch = Substitute.For <IQaBranch>();
            _parent   = Substitute.For <IExplorerBarItem>();
            _explorerBarItemsRepositoryFactory = Substitute.For <IExplorerBarItemsRepositoryFactory>();
            _explorerBarItemsRepository        = Substitute.For <IExplorerBarItemsRepository>();
            _explorerBarItemsRepositoryFactory.GetRepository(Arg.Any <IExplorerBarItem>()).Returns(_explorerBarItemsRepository);

            _pubSubMediator = new Spark.Wpf.Common.TestHelpers.MockPubSubMediator();

            _serviceLocator = ServiceLocatorBuilder.ServiceLocator()
                              .WithService(_explorerBarItemsRepositoryFactory)
                              .WithService(_pubSubMediator)
                              .Build();
        }
Esempio n. 14
0
        public GamePublisherTreeViewItem(IGamePublisherViewModel publisher, IExplorerBarItem parent, IServiceLocator serviceLocator)
            : base(publisher, parent, serviceLocator)
        {
            this.IsExpanded = true;

            publisher.MathPublisher.Do(p =>
            {
                this.Items.Add(new GameMathPublisherTreeViewItem(p, this, serviceLocator));
            });


            publisher.LimitsPublisher.Do(p =>
            {
                this.Items.Add(new GameLimitsPublisherTreeViewItem(p, this, serviceLocator));
            });
        }
Esempio n. 15
0
        public ProductionInstallersExplorerBarItem(IProductionEnvironment environment, IExplorerBarItem parent, IServiceLocator serviceLocator)
            : base(parent, serviceLocator)
        {
            _environment = environment;

            if (!UseLazyLoading)
            {
                foreach (var item in GetLazyLoadedItems())
                {
                    this.Items.Add(item);
                }
            }
        }
Esempio n. 16
0
 public DevBranchExplorerBarItem(IDevBranch devBranch, IExplorerBarItem parent, IServiceLocator serviceLocator)
     : base(devBranch, parent, serviceLocator)
 {
 }
Esempio n. 17
0
 public ExplorerBarItemsRepository(IServiceLocator serviceLocator, IExplorerBarItem parent)
 {
     _serviceLocator = serviceLocator;
     _parent         = parent;
 }
Esempio n. 18
0
 public QABranchExplorerBarItem(IQaBranch qaBranch, IExplorerBarItem parent, IServiceLocator serviceLocator)
     : base(qaBranch, parent, serviceLocator)
 {
     this.Items.Add(ItemsFactory.CreateQAInstallersItem(qaBranch));
 }
Esempio n. 19
0
 public CoreComponentPublisherTreeViewItem(ICoreComponentPublisherViewModel publisher,
                                           IExplorerBarItem parent,
                                           IServiceLocator serviceLocator)
     : base(publisher, parent, serviceLocator)
 {
 }
Esempio n. 20
0
 public ProductionInstallerExplorerBarItem(IProductionInstaller installer, IExplorerBarItem parent, IServiceLocator serviceLocator)
     : base(parent, serviceLocator)
 {
     _installer = installer;
     SubscribeToEvent <InstallerBranchedEventData>(InstallerBranchedHandler);
 }
Esempio n. 21
0
 public GameMathPublisherTreeViewItem(IGameMathPublisherViewModel mathPublisher, IExplorerBarItem parent, IServiceLocator serviceLocator)
     : base(mathPublisher, parent, serviceLocator)
 {
 }
Esempio n. 22
0
 public GameLimitsPublisherTreeViewItem(IGameLimitsPublisherViewModel limitsPublisher, IExplorerBarItem parent, IServiceLocator serviceLocator)
     : base(limitsPublisher, parent, serviceLocator)
 {
 }
Esempio n. 23
0
 public FoundItem(IExplorerBarItem item, ExplorerBarSearchViewModel searcher)
 {
     _item                = item;
     _searcher            = searcher;
     this.GoToItemCommand = new Command(() => { _searcher.Close(); _item.IsSelected = true; });
 }
Esempio n. 24
0
        public DevFeaturesBranchesExplorerBarItem(IDevBranch mainBranch, IExplorerBarItem parent, IServiceLocator serviceLocator)
            : base(mainBranch, parent, serviceLocator)

        {
        }
Esempio n. 25
0
 public QAFeatureBranchExplorerBarItem(IFeatureBranch featureBranch, IExplorerBarItem parent, IServiceLocator serviceLocator)
     : base(featureBranch, parent, serviceLocator)
 {
 }
Esempio n. 26
0
 public QaMainBranchExplorerBarItem(IQaBranch qaBranch,
                                    IExplorerBarItem parent,
                                    IServiceLocator serviceLocator)
     : base(qaBranch, parent, serviceLocator)
 {
 }
Esempio n. 27
0
 public FeaturesBranchesExplorerBarItem(TMainBranch mainBranch, IExplorerBarItem parent, IServiceLocator serviceLocator) : base(parent, serviceLocator)
 {
     this.MainBranch = mainBranch;
     LoadFeatureBranches();
     SubscribeToEvent <NewFeatureBranchEventData>(NewFeatureBranchEvent);
 }
Esempio n. 28
0
 public FeatureBranchExplorerBarItem(IFeatureBranch featureBranch, IExplorerBarItem parent,
                                     IServiceLocator serviceLocator) : base(parent, serviceLocator)
 {
     this.FeatureBranch = featureBranch;
 }
Esempio n. 29
0
 public MainBranchExplorerBarItem(TMainBranch mainBranch, IExplorerBarItem parent, IServiceLocator serviceLocator)
     : base(parent, serviceLocator)
 {
     this.MainBranch = mainBranch;
 }
Esempio n. 30
0
 public QaFeaturesBranchesExplorerBarItem(IQaBranch qaBranch, IExplorerBarItem parent, IServiceLocator serviceLocator)
     : base(qaBranch, parent, serviceLocator)
 {
 }