Exemplo n.º 1
0
        public FlickrService(IPhotoProcessor photoProcessor, IUiController ui, FlickrConfig config)
        {
            _ui             = ui;
            _config         = config;
            _photoProcessor = photoProcessor;
            _flickr         = new Flickr(_config.ApiKey, _config.ApiSecret);

            this.Authenticate();
        }
Exemplo n.º 2
0
    private void Awake()
    {
        _inputSystem      = GetComponent <IInputSystem>();
        _playerController = GetComponent <IPlayerController>();
        _enemyController  = GetComponent <IEnemyController>();
        _uiController     = GetComponent <IUiController>();

        _inputSystem.OnEscape   = OnEscape;
        _inputSystem.OnEscapeUp = () => _timeBeforeQuit = 0;
        _status = GameStatus.Start;
    }
Exemplo n.º 3
0
 public Workflow(IUiController uiController, IFlickrService flickrService,
                 IInputDocumentParser inputDocumentParser, IFileService fileService,
                 IValidator validator, IPostFormatter formatter, IPhotoProcessor photoProcessor)
 {
     _ui             = uiController;
     _flickr         = flickrService;
     _inputDocParser = inputDocumentParser;
     _fileSvc        = fileService;
     _formatter      = formatter;
     _validator      = validator;
     _photoProcessor = photoProcessor;
 }
        private void CreateApplicationEntities()
        {
            IAssetProvider        assetProvider   = new AssetProvider(new JsonParser());
            IEntitiesCreator      creator         = new EntitiesCreator(gameObject, assetProvider);
            ICoordinatesConverter coordsConverter = new CoordinatesConverter();
            IGeoJsonParser        geoParser       = new GeoJsonParser();
            IMeshGenerator        meshGenerator   = new MeshGenerator();
            IOutlineDrawer        outlineDrawer   = new OutlineDrawer();

            var mapModel = creator.CreateMapModel(mapNormal, mapForwardDirection, coordsConverter, geoParser);

            creator.CreateMapView(mapModel, meshGenerator, outlineDrawer);

            IMapScanner mapScanner = new MapScanner(mapModel.MapInfo);
            var         container  =
                creator.CreateProjectModelContainer(mapModel, coordsConverter);
            var controllerFactory = creator.CreateProjectControllerFactory(mapScanner, container);

            _manager = controllerFactory.ProjectsManager;

            _uiController = creator.CreateUiController();
        }
Exemplo n.º 5
0
        public void PlayTour(string url)
        {
            if (uiController is TourPlayer)
            {
                TourPlayer player = (TourPlayer)uiController;
                player.Stop(false);
            }

            tour = TourDocument.FromUrl(url, delegate
            {
                TourPlayer player = new TourPlayer();
                player.Tour = tour;
                tour.CurrentTourstopIndex = -1;
                uiController = player;
                player.Play();

            }
            );
        }
Exemplo n.º 6
0
        void SetAppMode(ApplicationMode mode)
        {
            if (ProjectorServer || NoUi)
            {
                return;
            }

            this.SuspendLayout();

            if (mode != currentMode)
            {
                switch (currentMode)
                {
                    case ApplicationMode.Search:
                        {
                            if (searchPane != null)
                            {
                                searchPane.Hide();
                            }
                        }
                        break;
                    case ApplicationMode.Tours:
                        {
                            if (toursTab != null)
                            {
                                toursTab.Hide();
                            }
                        }
                        break;
                    case ApplicationMode.Explore:
                        {
                            if (explorePane != null)
                            {
                                explorePane.Hide();
                            }
                        }
                        break;
                    case ApplicationMode.Community:
                        {
                            if (communitiesPane != null)
                            {
                                communitiesPane.Hide();
                            }
                        }
                        break;
                    case ApplicationMode.View:
                        {
                            if (viewPane != null)
                            {
                                viewPane.Hide();
                            }
                        }
                        break;
                    case ApplicationMode.Settings:
                        {
                            if (settingsPane != null)
                            {
                                settingsPane.Hide();
                            }
                        }
                        break;
                    case ApplicationMode.Telescope:
                        {
                            if (telescopePane != null)
                            {
                                telescopePane.Hide();
                            }
                        }
                        break;
                    case ApplicationMode.Tour1:
                    case ApplicationMode.Tour2:
                    case ApplicationMode.Tour3:
                    case ApplicationMode.Tour4:
                    case ApplicationMode.Tour5:
                        {
                            if (tourEdit != null)
                            {
                                tourEdit.Hide();
                            }
                        }

                        break;
                }
            }

            currentMode = mode;
            bool loadTours = false;

            switch (mode)
            {
                case ApplicationMode.Tours:
                    {
                        if (toursTab == null)
                        {
                            toursTab = new FolderBrowser();
                            toursTab.Owner = this;
                            loadTours = true;
                        }
                        ShowPane(toursTab);

                    }
                    break;
                case ApplicationMode.Community:
                    {
                        if (communitiesPane == null)
                        {
                            communitiesPane = new FolderBrowser();
                            communitiesPane.SetCommunitiesMode();
                            communitiesPane.Owner = this;
                            ShowPane(communitiesPane);
                            communitiesPane.Refresh();
                            communitiesPane.LoadCommunities();
                        }
                        else
                        {
                            ShowPane(communitiesPane);
                        }
                    }
                    break;
                case ApplicationMode.View:
                    {
                        if (viewPane == null)
                        {
                            viewPane = new View();
                            viewPane.Owner = this;
                        }
                        ShowPane(viewPane);
                    }
                    break;
                case ApplicationMode.Settings:
                    {
                        if (settingsPane == null)
                        {
                            settingsPane = new SettingsTab();
                            settingsPane.Owner = this;
                        }
                        ShowPane(settingsPane);
                    }
                    break;
                case ApplicationMode.Telescope:
                    {
                        if (telescopePane == null)
                        {
                            telescopePane = new TelescopeTab();
                            telescopePane.Owner = this;
                        }
                        ShowPane(telescopePane);
                    }
                    break;
                case ApplicationMode.Explore:
                    {
                        if (explorePane == null)
                        {
                            explorePane = new FolderBrowser();
                            explorePane.ShowMyFolders = true;
                            explorePane.SetExploreMode();
                            explorePane.LoadRootFoder(explorerRoot);
                            explorePane.Owner = this;
                        }
                        ShowPane(explorePane);
                    }
                    break;
                case ApplicationMode.Search:
                    {
                        if (searchPane == null)
                        {
                            searchPane = new Search();
                            searchPane.Owner = this;
                        }
                        ShowPane(searchPane);
                    }

                    break;
                case ApplicationMode.Tour1:
                case ApplicationMode.Tour2:
                case ApplicationMode.Tour3:
                case ApplicationMode.Tour4:
                case ApplicationMode.Tour5:
                    {
                        if (figureEditor != null)
                        {
                            figureEditor.SaveAndClose();
                        }

                        if (menuTabs.CurrentTour != null)
                        {
                            if (tourEdit == null)
                            {
                                tourEdit = new TourEditTab();
                                tourEdit.Owner = this;
                            }

                            if (tourEdit.Tour != menuTabs.CurrentTour)
                            {
                                tourEdit.Tour = menuTabs.CurrentTour;
                            }
                            ShowPane(tourEdit);

                            if (tourEdit.Tour.EditMode && !TourPlayer.Playing)
                            {
                                uiController = tourEdit.TourEditorUI;
                            }
                            TimeLine.SetTour(tourEdit.Tour);
                        }
                    }
                    break;
            }

            ShowContextPanel();


            if (imageStackVisible)
            {
                ShowImageStack();
            }

            ResumeLayout(true);

            if (Properties.Settings.Default.ShowLayerManager)
            {
                ShowLayersWindow();
            }

            if (figureEditor != null)
            {
                ShowFiguresEditorWindow();
            }


            if (currentTab != null)
            {
                currentTab.SetOpacity();
            }

            if (loadTours)
            {
                toursTab.LoadTours();
            }

            ClearClientArea = this.ClientRectangle;

            if (Properties.Settings.Default.TranparentWindows)
            {
                int widthUsed = 0;


                if (Properties.Settings.Default.ShowLayerManager)
                {
                    widthUsed += layerManager.Width;
                }

                ClearClientArea.Height -= (currentTab.Height + contextPanel.Height);
                ClearClientArea.Width -= widthUsed;
                ClearClientArea.Location = new Point(ClearClientArea.Location.X + widthUsed, ClearClientArea.Location.Y + currentTab.Height);
            }

            if (this.WindowState != FormWindowState.Minimized)
            {
                KeyFramer.ShowZOrder();
            }

        }
Exemplo n.º 7
0
        public void CloseTour(bool silent)
        {
            Undo.Clear();
            FreezeView();
            if (tourEdit != null)
            {
                TourPopup.CloseTourPopups();
                mover = null;
                TourPlayer.Playing = false;
                KeyFramer.HideTimeline();
                if (LayerManager.TourLayers == false && !silent)
                {
                    if (LayerManager.CheckForTourLoadedLayers())
                    {
                        if (UiTools.ShowMessageBox(Language.GetLocalizedText(1004, "Close layers loaded with the tour as well?"), Language.GetLocalizedText(3, "Microsoft WorldWide Telescope"), MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                        {
                            LayerManager.CloseAllTourLoadedLayers();
                        }
                        else
                        {
                            tourEdit.Tour.DontCleanUpTempFiles = true;
                            LayerManager.CleanAllTourLoadedLayers();
                        }


                    }
                }
                tourEdit.Tour.CurrentTourstopIndex = -1;
                tourEdit.Tour.CleanUp();
                tourEdit.Tour.ClearTempFiles();
                menuTabs.RemoveTour(tourEdit.Tour);
                tourEdit.TourEditorUI.Close();
                tourEdit.Close();
                tourEdit = null;
                uiController = null;
                Settings.TourSettings = null;
                if (toursTab == null)
                {
                    menuTabs.SetSelectedIndex(0, false);
                }
                else
                {
                    menuTabs.SetSelectedIndex(1, false);
                }

                LayerManager.TourLayers = false;
            }
        }
Exemplo n.º 8
0
        private void MainWndow_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
        {


            if (uiController != null)
            {
                if (uiController.KeyDown(sender, e))
                {
                    return;
                }
            }
            if (Control.ModifierKeys == Keys.Alt)
            {
                switch (e.KeyCode)
                {
                    case Keys.OemMinus:
                    case Keys.PageUp:
                    case Keys.Subtract:
                        zoomSpeed = (ZoomSpeeds)Properties.Settings.Default.ZoomSpeed;
                        ZoomOut();
                        break;
                    case Keys.PageDown:
                    case Keys.Oemplus:
                    case Keys.Add:
                        zoomSpeed = (ZoomSpeeds)Properties.Settings.Default.ZoomSpeed;
                        ZoomIn();
                        break;
                    case Keys.F1:
                        LaunchHelp();
                        break;
                    case Keys.F5:
                        TileCache.ClearCache();
                        Tile.fastLoad = true;
                        Tile.iTileBuildCount = 0;
                        break;
                    case Keys.Left:
                        RotateView(0, -.05);
                        break;
                    case Keys.Right:
                        RotateView(0, .05);
                        break;
                    case Keys.Up:
                        RotateView(-.01, 0);
                        break;
                    case Keys.Down:
                        RotateView(.01, 0);
                        break;

                }
            }
            else if (Control.ModifierKeys == Keys.Control)
            {
                switch (e.KeyCode)
                {
                    case Keys.F9:
                        config = new Config();
                        break;
                    case Keys.A:
                        useAsymetricProj = !useAsymetricProj;
                        break;
                    case Keys.F5:
                        Tile.PurgeRefresh = true;
                        Render();
                        Tile.PurgeRefresh = false;
                        TileCache.ClearCache();
                        break;
                    case Keys.E:
                        if (uiController == null)
                        {
                            // We can't really tell where this image came from so dirty everything.
                            FolderBrowser.AllDirty = true;
                            uiController = new ImageAlignmentUI();
                            Earth3d.MainWindow.StudyOpacity = 50;

                        }
                        else
                        {
                            if (uiController != null && uiController is ImageAlignmentUI)
                            {
                                ((ImageAlignmentUI)uiController).Close();
                            }
                            uiController = null;
                        }
                        break;

                    case Keys.L:
                        Logging = !Logging;

                        break;
                    case Keys.T:
                        targetViewCamera = viewCamera = CustomTrackingParams;
                        break;
                }
            }
            else
            {
                switch (e.KeyCode)
                {
                    case Keys.Z:
                        riftFov *= .99f;
                        this.Text = riftFov.ToString();
                        break;
                    case Keys.X:
                        riftFov *= 1.01f;
                        this.Text = riftFov.ToString();
                        break;
                    case Keys.C:
                        iod *= .99f;
                        break;
                    case Keys.V:
                        iod *= 1.01f;
                        break;
                    case Keys.F:
                        SpaceTimeController.Faster();
                        break;
                    case Keys.S:
                        SpaceTimeController.Slower();
                        break;
                    case Keys.H:
                        // turn friction on and off
                        Friction = !Friction;
                        break;
                    case Keys.P:
                        SpaceTimeController.PauseTime();
                        break;
                    case Keys.N:
                        SpaceTimeController.SetRealtimeNow();
                        break;
                    case Keys.B:
                        blink = !blink;
                        break;
                    case Keys.L:
                        RenderContext11.SetLatency(3);
                        break;
                    case Keys.K:
                        RenderContext11.SetLatency(1);
                        break;
                    case Keys.F5:
                        TileCache.ClearCache();
                        Tile.iTileBuildCount = 0;
                        break;
                    case Keys.F11:
                        ShowFullScreen(!fullScreen);
                        break;
                    case Keys.OemMinus:
                    case Keys.PageUp:
                    case Keys.Subtract:
                        zoomSpeed = (ZoomSpeeds)Properties.Settings.Default.ZoomSpeed;
                        ZoomOut();
                        break;
                    case Keys.Oemplus:
                    case Keys.PageDown:
                    case Keys.Add:
                        zoomSpeed = (ZoomSpeeds)Properties.Settings.Default.ZoomSpeed;
                        ZoomIn();
                        break;
                    case Keys.F3:

                        break;
                    case Keys.F1:
                        LaunchHelp();
                        break;
                    case Keys.F2:
                        showWireFrame = !showWireFrame;
                        break;
                    case Keys.Left:
                        Control c = UiTools.GetFocusControl();
                        MoveLeft();
                        break;
                    case Keys.Right:
                        MoveRight();
                        break;
                    case Keys.Up:
                        MoveUp();
                        break;
                    case Keys.Down:
                        MoveDown();
                        break;
                    case Keys.Space:
                    case Keys.Play:
                        if (TourEdit != null)
                        {
                            TourEdit.PlayNow(false);
                        }
                        break;
                    case Keys.Escape:
                        if (fullScreen)
                        {
                            ShowFullScreen(false);
                        }
                        break;
                }
            }
        }
Exemplo n.º 9
0
 public UserController(IUiController menu, IDbController db)
 {
     _uiController = menu;
     _dbController = db;
 }