Ejemplo n.º 1
0
        public EditFolderViewModel(IAbstractFolder abstractFolder, IWorkbook workbook, INavigationService navigationService, IMessageBoxService messageBoxService, IPlatformService platformService, ITileManager tileManager)
            : base(workbook, navigationService, messageBoxService, platformService)
        {
            if (abstractFolder == null)
            {
                throw new ArgumentNullException("abstractFolder");
            }
            if (tileManager == null)
            {
                throw new ArgumentNullException("tileManager");
            }

            this.abstractFolder = abstractFolder;
            this.tileManager    = tileManager;

            this.Title       = abstractFolder.Name;
            this.IsAscending = abstractFolder.GroupAscending;
            this.TaskGroup   = abstractFolder.TaskGroup;

            this.SelectedColorIndex = ColorChooser.GetColorIndex(abstractFolder.Color);
            this.SelectedIcon       = abstractFolder.IconId;

            if (abstractFolder is IFolder)
            {
                var folder = (IFolder)abstractFolder;
                this.ShowInViews = folder.ShowInViews.HasValue && folder.ShowInViews.Value;
            }
        }
        public InformationViewModel(INavigationService pageNavigationService, ITileManager tileManager) : base(pageNavigationService)
        {
            _pageNavigationService = pageNavigationService;
            _tileManager           = tileManager;

            message = "Dolar Argentina provee la cotización del Dolar y el Euro en Argentina actualziada diariamente";
        }
Ejemplo n.º 3
0
 public Generator(ITileManager manager, IOreTable oreTable, IDrawer drawer, IGeneratorParameters parameters)
 {
     this.manager    = manager;
     this.oreTable   = oreTable;
     this.drawer     = drawer;
     this.parameters = parameters;
     CanGenerateTree = this.parameters.TreeSpread;
 }
Ejemplo n.º 4
0
 public EditBookPageViewModel(
     IBookRepository bookRepository,
     INavigationService navigationService,
     ITileManager tileManager)
 {
     _bookRepository    = bookRepository;
     _navigationService = navigationService;
     _tileManager       = tileManager;
 }
 public EditBookPageViewModel(
     IBookRepository bookRepository, 
     INavigationService navigationService,
     ITileManager tileManager)
 {
     _bookRepository = bookRepository;
     _navigationService = navigationService;
     _tileManager = tileManager;
 }
Ejemplo n.º 6
0
 public SaveManager(ITileManager manager, PlayerStatus status, BlockConverter converter, Center center, IMover mover)
 {
     Manager    = manager;
     Status     = status;
     Converter  = converter;
     Center     = center;
     Mover      = mover;
     Serializer = new XmlSerializer(typeof(Save));
 }
Ejemplo n.º 7
0
 public SettingsViewModel(ISettingsManager settingsManager,
                          IPasswordStorage passwordStorage,
                          ITileManager tileManager,
                          IDialogService dialogService)
 {
     SettingsGeneralViewModel         = new SettingsGeneralViewModel(settingsManager);
     SettingsSecurityViewModel        = new SettingsSecurityViewModel(settingsManager, passwordStorage, dialogService);
     SettingsShortcutsViewModel       = new SettingsShortcutsViewModel(settingsManager, tileManager);
     SettingsPersonalizationViewModel = new SettingsPersonalizationViewModel(settingsManager);
 }
Ejemplo n.º 8
0
        public EditTaskViewModel(IWorkbook workbook, INavigationService navigationService, IMessageBoxService messageBoxService, INotificationService notificationService, ITileManager tileManager, ISynchronizationManager synchronizationManager, ISpeechService speechService, ITrackingManager trackingManager, IPlatformService platformService)
            : base(workbook, navigationService, messageBoxService, notificationService, synchronizationManager, speechService, trackingManager, platformService)
        {
            if (tileManager == null)
            {
                throw new ArgumentNullException(nameof(tileManager));
            }

            this.tileManager = tileManager;
        }
Ejemplo n.º 9
0
 public PointerController(PlayerStatus status, ITileManager engine, IMoveDefiner moveDefiner, IDrawer drawer, IPixSound sound, IPointerControllerParameters parameters, IEntitiesData entities, IMouse mouse) : base(drawer)
 {
     this.status              = status;
     Tiles                    = engine;
     this.moveDefiner         = moveDefiner;
     Sound                    = sound;
     Parameters               = parameters;
     Entities                 = entities;
     Mouse                    = mouse;
     ChangeStateOfPointerTask = new Task(ChangeStateOfPointer);
 }
Ejemplo n.º 10
0
 public ReadPageViewModel(
     INavigationService navigationService,
     ITileManager tileManager,
     IBookRepository bookRepository,
     SharingDataModel sharingDataModel,
     IBusyOverlayManager busyOverlay)
 {
     SharingDataModel   = sharingDataModel;
     _navigationService = navigationService;
     _tileManager       = tileManager;
     _bookRepository    = bookRepository;
     _busyOverlay       = busyOverlay;
 }
Ejemplo n.º 11
0
 public ReadPageViewModel(
     INavigationService navigationService,
     ITileManager tileManager, 
     IBookRepository bookRepository,
     SharingDataModel sharingDataModel,
     IBusyOverlayManager busyOverlay)
 {
     SharingDataModel = sharingDataModel;
     _navigationService = navigationService;
     _tileManager = tileManager;
     _bookRepository = bookRepository;
     _busyOverlay = busyOverlay;
 }
Ejemplo n.º 12
0
        public SettingsViewModel(ISettingsManager settingsManager,
                                 IPasswordStorage passwordStorage,
                                 ITileManager tileManager,
                                 IBackgroundTaskManager backgroundTaskManager,
                                 IDialogService dialogService,
                                 IMvxNavigationService navigationService)
        {
            this.navigationService = navigationService;

            SettingsBackgroundJobViewModel   = new SettingsBackgroundJobViewModel(settingsManager, backgroundTaskManager);
            SettingsSecurityViewModel        = new SettingsSecurityViewModel(settingsManager, passwordStorage, dialogService);
            SettingsShortcutsViewModel       = new SettingsShortcutsViewModel(settingsManager, tileManager);
            SettingsPersonalizationViewModel = new SettingsPersonalizationViewModel(settingsManager);
        }
Ejemplo n.º 13
0
        public UserLibraryPageViewModel(
            IBookRepository bookRepository,
            INavigationService navigationService,
            IEventAggregator eventAggregator,
            ITileManager tileManager)
        {
            _bookRepository    = bookRepository;
            _navigationService = navigationService;
            _eventAggregator   = eventAggregator;
            _tileManager       = tileManager;
            DisplayName        = UIStrings.UserLibraryPage_Title;
            PageTitle          = UIStrings.UserLibraryPage_Title;

            _selectedSortMode = _sortModesCollection.SingleOrDefault(s => s.Key == SortMode.Name);

            eventAggregator.Subscribe(this);
        }
Ejemplo n.º 14
0
        public MainViewModel(INavigationService pageNavigationService, IRestClient restClient, IMessageDialog messageDialog, ITileManager tileManager, ILocalSettings localSettings) : base(pageNavigationService)
        {
            Caption = "Cotización en Argentina";

            _pageNavigationService = pageNavigationService;
            _restClient            = restClient;
            _messageDialog         = messageDialog;
            _tileManager           = tileManager;
            _localSettings         = localSettings;

            if (!DesignMode.DesignModeEnabled)
            {
                PopulateRatesAsync();

                RegisterBackGroundTaskAsync();

                UpdateTile();
            }
        }
Ejemplo n.º 15
0
 public GameManager
 (
     IAnimationManager animationManager,
     ICollisionManager collisionManager,
     IConfigManager configManager,
     IContentManager contentManager,
     IEnemysManager enemysManager,
     IInputManager inputManager,
     ILevelManager levelManager,
     IPlayerManager playerManager,
     IPhysicsManager physicsManager,
     IRandomManager randomManager,
     IResolutionManager resolutionManager,
     IScreenManager screenManager,
     ISoundManager soundManager,
     IScrollManager scrollManager,
     IStateManager stateManager,
     ITileManager tileManager,
     IFileManager fileManager,
     ILogger logger
 )
 {
     AnimationManager  = animationManager;
     CollisionManager  = collisionManager;
     ConfigManager     = configManager;
     ContentManager    = contentManager;
     EnemysManager     = enemysManager;
     InputManager      = inputManager;
     LevelManager      = levelManager;
     PlayerManager     = playerManager;
     PhysicsManager    = physicsManager;
     RandomManager     = randomManager;
     ResolutionManager = resolutionManager;
     SoundManager      = soundManager;
     ScreenManager     = screenManager;
     ScrollManager     = scrollManager;
     StateManager      = stateManager;
     TileManager       = tileManager;
     FileManager       = fileManager;
     Logger            = logger;
 }
Ejemplo n.º 16
0
#pragma warning restore 618
        public void TestFixtureSetUp()
        {
            AnimationManager  = MockRepository.GenerateStub <IAnimationManager>();
            CollisionManager  = MockRepository.GenerateStub <ICollisionManager>();
            ConfigManager     = MockRepository.GenerateStub <IConfigManager>();
            ContentManager    = MockRepository.GenerateStub <IContentManager>();
            EnemysManager     = MockRepository.GenerateStub <IEnemysManager>();
            InputManager      = MockRepository.GenerateStub <IInputManager>();
            LevelManager      = MockRepository.GenerateStub <ILevelManager>();
            PlayerManager     = MockRepository.GenerateStub <IPlayerManager>();
            PhysicsManager    = MockRepository.GenerateStub <IPhysicsManager>();
            RandomManager     = MockRepository.GenerateStub <IRandomManager>();
            ResolutionManager = MockRepository.GenerateStub <IResolutionManager>();
            ScreenManager     = MockRepository.GenerateStub <IScreenManager>();
            SoundManager      = MockRepository.GenerateStub <ISoundManager>();
            ScrollManager     = MockRepository.GenerateStub <IScrollManager>();
            StateManager      = MockRepository.GenerateStub <IStateManager>();
            TileManager       = MockRepository.GenerateStub <ITileManager>();
            FileManager       = MockRepository.GenerateStub <IFileManager>();
            Logger            = MockRepository.GenerateStub <ILogger>();
        }
Ejemplo n.º 17
0
#pragma warning restore 618
        public void TestFixtureTearDown()
        {
            AnimationManager  = null;
            CollisionManager  = null;
            ConfigManager     = null;
            ContentManager    = null;
            EnemysManager     = null;
            InputManager      = null;
            LevelManager      = null;
            PlayerManager     = null;
            PhysicsManager    = null;
            RandomManager     = null;
            ResolutionManager = null;
            ScreenManager     = null;
            SoundManager      = null;
            ScrollManager     = null;
            StateManager      = null;
            TileManager       = null;
            FileManager       = null;
            Logger            = null;
        }
Ejemplo n.º 18
0
        internal SuspensionManager(IPersistenceLayer persistenceLayer, ISynchronizationManager synchronizationManager, ITileManager tileManager)
        {
            if (persistenceLayer == null)
            {
                throw new ArgumentNullException(nameof(persistenceLayer));
            }
            if (synchronizationManager == null)
            {
                throw new ArgumentNullException(nameof(synchronizationManager));
            }
            if (tileManager == null)
            {
                throw new ArgumentNullException(nameof(tileManager));
            }

            this.persistenceLayer       = persistenceLayer;
            this.synchronizationManager = synchronizationManager;
            this.tileManager            = tileManager;

            this.synchronizationManager.OperationCompleted += this.OnSyncCompleted;
            this.synchronizationManager.OperationFailed    += this.OnSyncFailed;
        }
Ejemplo n.º 19
0
        private void Start()
        {
            m_TileManager = GetComponent <ITileManager>();

            // TODO: Add code here to allow user to switch out tiles easily. This will require changing the tilemanager attatched to the gameobject.

            if (m_TileManager == null)
            {
                if (LogFilter.logFatal)
                {
                    Debug.LogErrorFormat("{1} Requires a tile manager component", TAG);
                }
            }

            // calculate quad size
            float quadWidth  = m_TileManager.GetGridTileWidth() / m_TileManager.GetGridTileHeight();
            float quadHeight = m_TileManager.GetGridTileHeight() / m_TileManager.GetGridTileWidth();

            // calculate ui width scaling
            float scaledWidth = m_TileManager.GetUITileWidth() / m_TileManager.GetUITileHeight();

            // derive displayheight from desired display width
            int maxDisplayHeight = Mathf.RoundToInt((((float)Screen.height / (float)Screen.width) * (float)DisplayWidth) / quadHeight);

            // calculate the height adjustment needed to center the camera if the display isn't auto calibrated.
            float yCameraAdjust = (DisplayHeight - maxDisplayHeight) / 2F * quadHeight;

            // update camera orthographic size and position
            MainCamera.orthographicSize = (((float)Screen.height / (float)Screen.width) * (float)DisplayWidth) / quadHeight * quadHeight * 0.5F;
            var vec = MainCamera.transform.position;

            MainCamera.transform.position = new Vector3(vec.x, yCameraAdjust, vec.z);

            if (LogFilter.logInfo)
            {
                Debug.LogFormat("{0} Display Size: {1}x{2}", TAG, DisplayWidth, DisplayHeight);
            }

            // template primitive for creating quad meshes.
            var go = GameObject.CreatePrimitive(PrimitiveType.Quad);

            Destroy(go.GetComponent <MeshCollider>());

            // Create the consoles that will be used for updating cells.
            foreach (Console console in m_Consoles)
            {
                switch (console.WidthScaling)
                {
                case Console.ENUM_WidthScaling.Fixed:
                    console.Create(go, m_TileManager.GetGridMaterial(), DisplayWidth, DisplayHeight, m_TileManager, quadWidth);
                    break;

                case Console.ENUM_WidthScaling.Scaled:
                    console.Create(go, m_TileManager.GetUIMaterial(), DisplayWidth, DisplayHeight, m_TileManager, scaledWidth);
                    break;
                }
            }

            //destroy template and complete intialization
            Destroy(go);
            Initialized = true;
        }
Ejemplo n.º 20
0
        public void Create(GameObject go, Material foregroundMaterial, int screenWidth, int screenHeight, ITileManager tileManager, float widthRatio)
        {
            int xStart = (int)Start.x;
            int yStart = (int)Start.y;
            int xEnd   = (int)End.x;
            int yEnd   = (int)End.y;

            m_TileManager = tileManager;

            // Calculate the console dimensions.
            displayWidth  = Mathf.RoundToInt((xEnd - xStart));
            displayHeight = Mathf.RoundToInt((yEnd - yStart));

            // Calculate the max number of tiles that can fit in aspect ratio.
            int maxTile = Mathf.RoundToInt((((float)Screen.height / (float)Screen.width) * (float)screenWidth) / 1F);

            // Calculate heigh scaling adjustment to fit inside aspect ratio.
            float adjust = (((float)maxTile / (float)screenHeight));

            quadHeight = 1F * adjust;

            // Does the width scale. This increases number of horizontal tiles, but makes them not square. Used for displaying UI text, not maps.
            switch (WidthScaling)
            {
            case ENUM_WidthScaling.Fixed:
                quadWidth = 1F;
                break;

            case ENUM_WidthScaling.Scaled:
                quadWidth = 1F * widthRatio;
                break;
            }
            displayWidth = Mathf.RoundToInt(displayWidth / quadWidth);

            // Create cells
            Cells = new Cell[displayWidth, displayHeight];
            for (int y = 0; y < displayHeight; y++)
            {
                for (int x = 0; x < displayWidth; x++)
                {
                    Cells[x, y] = CreateCell(x, y);
                }
            }
            DirtyCells = new Stack <Cell>(MaxDirtCells * 2);

            // Instantiate quads
            int quadMeshFilterIndex = 0;

            MeshFilter[] quadMeshFilters = new MeshFilter[displayWidth * displayHeight];
            for (int y = 0; y < displayHeight; y++)
            {
                for (int x = 0; x < displayWidth; x++)
                {
                    // Instantiate from prefab
                    GameObject quad = (GameObject)GameObject.Instantiate(go);
                    quad.transform.parent     = transform;
                    quad.transform.localScale = new Vector3(quadWidth, quadHeight, 1f);
                    quad.transform.position   = new Vector3(x * quadWidth + quadWidth * 0.5f, -y * quadHeight - quadHeight * 0.5f, 0f);

                    // Add to array for combining later
                    quadMeshFilters[quadMeshFilterIndex] = quad.GetComponent <MeshFilter>();
                    quadMeshFilterIndex++;
                }
            }

            // Add quads to combine instances
            CombineInstance[] combineInstances = new CombineInstance[quadMeshFilters.Length];
            for (int i = 0; i < quadMeshFilters.Length; i++)
            {
                combineInstances[i].mesh      = quadMeshFilters[i].sharedMesh;
                combineInstances[i].transform = quadMeshFilters[i].transform.localToWorldMatrix;
            }

            // Combine quads to foreground and background
            Background.CreateMesh(combineInstances, "background_quads", backgroundMaterial, xStart - screenWidth * 1 / 2, screenHeight * 1 / 2 - yStart * quadHeight, 0.001F);
            Foreground.CreateMesh(combineInstances, "foreground_quads", foregroundMaterial, xStart - screenWidth * 1 / 2, screenHeight * 1 / 2 - yStart * quadHeight, 0F);
            Animation.CreateMesh(combineInstances, "animation_quads", foregroundMaterial, xStart - screenWidth * 1 / 2, screenHeight * 1 / 2 - yStart * quadHeight, -0.001F);

            // Destroy original quads
            for (int i = quadMeshFilters.Length - 1; i >= 0; i--)
            {
                GameObject.Destroy(quadMeshFilters[i].gameObject);
            }
            quadMeshFilters = null;

            transform.position = new Vector3(0, 0, -1 * (int)Layer);
            Initialized        = true;
        }
 /// <summary>
 ///     Creates a SettingsShortcutsViewModel object
 /// </summary>
 public SettingsShortcutsViewModel(ISettingsManager settingsManager, ITileManager tileManager)
 {
     this.settingsManager = settingsManager;
     this.tileManager = tileManager;
 }
Ejemplo n.º 22
0
        public MainPage()
        {
            this.InitializeComponent();

            this.workbook          = Ioc.Resolve <IWorkbook>();
            this.navigationService = Ioc.Resolve <INavigationService>();
            this.messageBoxService = Ioc.Resolve <IMessageBoxService>();
            this.trackingManager   = Ioc.Resolve <ITrackingManager>();
            this.tileManager       = Ioc.Resolve <ITileManager>();
            this.platformService   = Ioc.Resolve <IPlatformService>();

            // setup cache mode so that this page is cached accross navigation
            this.NavigationCacheMode = NavigationCacheMode.Required;

            this.viewModel = Ioc.Build <MainPageViewModel>();
            this.viewModel.PropertyChanged += this.OnViewModelPropertyChanged;
            Ioc.RegisterInstance <IMainPageViewModel, MainPageViewModel>(this.viewModel);

            this.navigationMenuManager    = Ioc.Build <NavigationMenuManager>();
            this.taskListSelectionManager = new GridViewSelectionManager(this.workbook, this.viewModel, this.GridViewTasks);
            this.dragDropManager          = new DragDropManager(this, this.GridViewTasks, this.ListViewNavigation, this.workbook, this.navigationService, this.trackingManager);

            this.lastSplitViewOpen = !this.workbook.Settings.GetValue <bool>(CoreSettings.NavigationMenuMinimized);

            this.Loaded      += this.OnLoaded;
            this.SizeChanged += this.OnSizeChanged;

            this.DataContext = this.viewModel;

            this.HeaderBarAutoSuggestBox.QuerySubmitted += (s, e) =>
            {
                this.HeaderBarAutoSuggestBox.Focus(FocusState.Programmatic);
            };
            this.HeaderBarAutoSuggestBox.GotFocus += (s, e) =>
            {
                this.PanelHeaderContent.Visibility = Visibility.Collapsed;
                this.HeaderBarAutoSuggestBoxBorderMask.Visibility = Visibility.Collapsed;
            };
            this.HeaderBarAutoSuggestBox.LostFocus += (s, e) =>
            {
                if (string.IsNullOrWhiteSpace(this.ViewModel.SearchText))
                {
                    this.PanelHeaderContent.Visibility = Visibility.Visible;
                    this.HeaderBarAutoSuggestBoxBorderMask.Visibility = Visibility.Visible;
                }
            };

            // when user types text in the search box, update the view model
            var synchronizationContext = SynchronizationContext.Current;

            Observable
            .FromEventPattern <AutoSuggestBoxTextChangedEventArgs>(this.NavBarAutoSuggestBox, "TextChanged")
            .Throttle(TimeSpan.FromMilliseconds(250))
            .ObserveOn(synchronizationContext)
            .Subscribe(e => this.viewModel.SearchText = this.NavBarAutoSuggestBox.Text);
            Observable
            .FromEventPattern <AutoSuggestBoxTextChangedEventArgs>(this.HeaderBarAutoSuggestBox, "TextChanged")
            .Throttle(TimeSpan.FromMilliseconds(250))
            .ObserveOn(synchronizationContext)
            .Subscribe(e => this.viewModel.SearchText = this.HeaderBarAutoSuggestBox.Text);

            DataTransferManager.GetForCurrentView().DataRequested += this.OnDataRequested;

            this.SplitView.RegisterPropertyChangedCallback(SwipeableSplitView.IsSwipeablePaneOpenProperty, this.OnSplitViewIsOpenChanged);

            this.ContextualActionBar.Visibility = Visibility.Collapsed;
            this.ContextualActionBar.Initialize(this.SelectionManager);

            this.ListViewTasks.Tapped += (s, e) =>
            {
                this.navigationService.CloseFlyouts();
            };
        }
Ejemplo n.º 23
0
 public Engine(ITileManager tileManager, IDrawer drawer)
 {
     Center      = new Center(drawer);
     manager     = tileManager;
     this.drawer = drawer;
 }
        public GeneralSettingsPageViewModel(IWorkbook workbook, INavigationService navigationService, ITileManager tileManager)
            : base(workbook, navigationService)
        {
            if (tileManager == null)
            {
                throw new ArgumentNullException(nameof(tileManager));
            }

            this.tileManager           = tileManager;
            this.defaultContextChoices = new List <IContext>(this.Workbook.Contexts);
            this.defaultContextChoices.Insert(0, null);

            this.badgeValues = new List <IAbstractFolder> {
                new Folder {
                    Name = StringResources.Settings_NoBadgeValue.ToLowerInvariant()
                }
            };
            this.badgeValues.AddRange(this.Workbook.Views);
            this.badgeValues.AddRange(this.Workbook.SmartViews);
            this.badgeValues.AddRange(this.Workbook.Folders);
            this.badgeValues.AddRange(this.Workbook.Contexts);
            this.badgeValues.AddRange(this.Workbook.Tags);

            AutoDeleteFrequency frequency = this.Settings.GetValue <AutoDeleteFrequency>(CoreSettings.AutoDeleteFrequency);

            this.selectedAutoDelete = frequency.GetDescription();

            TaskPriority priority = this.Settings.GetValue <TaskPriority>(CoreSettings.DefaultPriority);

            this.selectedDefaultPriority = priority.GetDescription();

            string badgeValue = this.Settings.GetValue <string>(CoreSettings.BadgeValue);

            if (!string.IsNullOrWhiteSpace(badgeValue))
            {
                var descriptor = LaunchArgumentsHelper.GetDescriptorFromArgument(this.Workbook, badgeValue);
                if (descriptor != null && descriptor.Folder != null)
                {
                    this.originalSelectedBadgeValue = descriptor.Folder;
                    this.selectedBadgeValue         = descriptor.Folder;
                }
            }

            if (this.selectedBadgeValue == null)
            {
                this.selectedBadgeValue = this.badgeValues[0];
            }

            int      contextId      = this.Settings.GetValue <int>(CoreSettings.DefaultContext);
            IContext defaultContext = this.Workbook.Contexts.FirstOrDefault(c => c.Id == contextId);

            if (defaultContext != null)
            {
                this.selectedDefaultContext = defaultContext;
            }

            DefaultDate defaultDueDate = this.Settings.GetValue <DefaultDate>(CoreSettings.DefaultDueDate);

            this.selectedDefaultDueDate = defaultDueDate.GetDescription();

            DefaultDate defaultStartDate = this.Settings.GetValue <DefaultDate>(CoreSettings.DefaultStartDate);

            this.selectedDefaultStartDate = defaultStartDate.GetDescription();

            CompletedTaskMode completedTaskMode = this.Settings.GetValue <CompletedTaskMode>(CoreSettings.CompletedTasksMode);

            this.selectedCompletedTaskMode = completedTaskMode.GetDescription();

            this.useGroupedDates          = this.Settings.GetValue <bool>(CoreSettings.UseGroupedDates);
            this.showNoDueWithOther       = this.Settings.GetValue <bool>(CoreSettings.IncludeNoDateInViews);
            this.showFutureStartDates     = this.Settings.GetValue <bool>(CoreSettings.ShowFutureStartDates);
            this.autoDeleteTags           = this.Settings.GetValue <bool>(CoreSettings.AutoDeleteTags);
            this.completeTaskSetsProgress = this.Settings.GetValue <bool>(CoreSettings.CompleteTaskSetProgress);
        }
Ejemplo n.º 25
0
        protected MainPageViewModelBase(IWorkbook workbook, ISynchronizationManager synchronizationManager, IStartupManager startupManager, IMessageBoxService messageBoxService, INotificationService notificationService, INavigationService navigationService, IPlatformService platformService, ITileManager tileManager, ITrackingManager trackingManager, ISpeechService speechService)
            : base(workbook, navigationService)
        {
            if (startupManager == null)
            {
                throw new ArgumentNullException(nameof(startupManager));
            }
            if (synchronizationManager == null)
            {
                throw new ArgumentNullException(nameof(synchronizationManager));
            }
            if (messageBoxService == null)
            {
                throw new ArgumentNullException(nameof(messageBoxService));
            }
            if (platformService == null)
            {
                throw new ArgumentNullException(nameof(platformService));
            }
            if (notificationService == null)
            {
                throw new ArgumentNullException(nameof(notificationService));
            }
            if (tileManager == null)
            {
                throw new ArgumentNullException(nameof(tileManager));
            }
            if (trackingManager == null)
            {
                throw new ArgumentNullException(nameof(trackingManager));
            }
            if (speechService == null)
            {
                throw new ArgumentNullException(nameof(speechService));
            }

            this.synchronizationManager = synchronizationManager;
            this.messageBoxService      = messageBoxService;
            this.notificationService    = notificationService;
            this.platformService        = platformService;
            this.tileManager            = tileManager;
            this.trackingManager        = trackingManager;
            this.speechService          = speechService;

            this.synchronizationManager.OperationStarted         += this.OnSyncStarted;
            this.synchronizationManager.OperationProgressChanged += this.OnSyncProgressChanged;
            this.synchronizationManager.OperationCompleted       += this.OnSyncOperationCompleted;
            this.synchronizationManager.OperationFailed          += this.OnSyncOperationFailed;
            this.synchronizationManager.PropertyChanged          += (s, e) =>
            {
                if (e.PropertyName == "ActiveService")
                {
                    this.RaisePropertyChanged("SyncPrioritySupport");
                }
            };

            this.Workbook.Settings.KeyChanged += this.OnSettingsChanged;
            this.Workbook.TaskAdded           += this.OnTaskAddded;

            this.Workbook.FoldersReordered  += this.OnFolderReordered;
            this.Workbook.ContextsReordered += this.OnContextReordered;

            this.addViewCommand      = new RelayCommand(this.AddViewExecute);
            this.addSmartViewCommand = new RelayCommand(this.AddSmartViewExecute);
            this.addFolderCommand    = new RelayCommand(this.AddFolderExecute);
            this.addContextCommand   = new RelayCommand(this.AddContextExecute);
            this.addTaskCommand      = new RelayCommand(this.AddTaskExecute);
            this.syncCommand         = new RelayCommand(this.SyncExecute);
            this.openSettingsCommand = new RelayCommand(this.OpenSettingsExecute);
            this.openDebugCommand    = new RelayCommand(this.OpenDebugExecute);
            this.clearSearchCommand  = new RelayCommand(this.ClearSearchExecute);
            this.speechCommand       = new RelayCommand(this.SpeechExecute);
            this.quickSpeechCommand  = new RelayCommand(this.QuickSpeechExecute);
            this.printCommand        = new RelayCommand(this.PrintExecute);
            this.shareCommand        = new RelayCommand(this.ShareExecute);
            this.editCommand         = new RelayCommand(this.EditExecute);

            this.deleteSelectionCommand      = new RelayCommand(this.DeleteSelectionExecute);
            this.completeSelectionCommand    = new RelayCommand(this.CompleteSelectionExecute);
            this.toggleTaskCompletionCommand = new RelayCommand <ITask>(this.ToggleTaskCompletionExecute);
            this.setPrioritySelectionCommand = new RelayCommand <string>(this.SetPrioritySelectionExecute);

            this.menuItems = new SortableObservableCollection <MenuItemViewModel>();

            bool hasViews      = this.Workbook.Views.Any(v => v.IsEnabled);
            bool hasSmartViews = this.Workbook.SmartViews.Any();
            bool hasFolders    = this.Workbook.Folders.Any();
            bool hasContexts   = this.Workbook.Contexts.Any();

            // create search view
            this.viewSearch       = new ViewSearch(this.Workbook);
            this.searchFolderItem = new FolderItemViewModel(this.Workbook, this.viewSearch);

            // load views
            foreach (var view in this.Workbook.Views.Where(f => f.IsEnabled))
            {
                this.menuItems.Add(new FolderItemViewModel(workbook, view));
            }

            // load smart views
            if (this.Workbook.SmartViews.Any())
            {
                if (hasViews)
                {
                    this.menuItems.Add(new SeparatorItemViewModel(Constants.SeparatorSmartViewId));
                }

                foreach (var smartview in this.Workbook.SmartViews)
                {
                    this.menuItems.Add(new FolderItemViewModel(workbook, smartview));
                }
            }

            // load folders
            if (this.Workbook.Folders.Count > 0)
            {
                if (hasViews || hasSmartViews)
                {
                    this.menuItems.Add(new SeparatorItemViewModel(Constants.SeparatorFolderId));
                }

                foreach (var folder in this.Workbook.Folders)
                {
                    this.menuItems.Add(new FolderItemViewModel(workbook, folder));
                }
            }

            // load contexts
            if (this.Workbook.Contexts.Count > 0)
            {
                if (hasViews || hasSmartViews || hasFolders)
                {
                    this.menuItems.Add(new SeparatorItemViewModel(Constants.SeparatorContextId));
                }

                foreach (var context in this.Workbook.Contexts)
                {
                    this.menuItems.Add(new FolderItemViewModel(workbook, context));
                }
            }

            // load tags
            if (this.Workbook.Tags.Any())
            {
                if (hasViews || hasSmartViews || hasFolders || hasContexts)
                {
                    this.menuItems.Add(new SeparatorItemViewModel(Constants.SeparatorTagId));
                }

                foreach (var tag in this.Workbook.Tags)
                {
                    this.menuItems.Add(new FolderItemViewModel(workbook, tag));
                }
            }
        }
Ejemplo n.º 26
0
 /// <summary>
 ///     Creates a SettingsShortcutsViewModel object
 /// </summary>
 public SettingsShortcutsViewModel(ISettingsManager settingsManager, ITileManager tileManager)
 {
     this.settingsManager = settingsManager;
     this.tileManager     = tileManager;
 }
Ejemplo n.º 27
0
 public MainPageViewModel(IWorkbook workbook, ISynchronizationManager synchronizationManager, IStartupManager startupManager, IMessageBoxService messageBoxService, INotificationService notificationService, INavigationService navigationService, IPlatformService platformService, ITileManager tileManager, ITrackingManager trackingManager, ISpeechService speechService)
     : base(workbook, synchronizationManager, startupManager, messageBoxService, notificationService, navigationService, platformService, tileManager, trackingManager, speechService)
 {
     this.printHelper  = new PrintHelper(this.messageBoxService);
     this.jobScheduler = new AppJobScheduler(this.Workbook, this.synchronizationManager, () => this.MenuItems.OfType <FolderItemViewModel>());
 }
Ejemplo n.º 28
0
Archivo: Map.cs Proyecto: hnjm/Discarta
 public Map()
 {
     tileManager  = new RenderingTileManager();
     Loaded      += MapLoaded;
     ClipToBounds = true;
 }