Exemplo n.º 1
0
        //TODO Search Query Help
        //TODO Tags Parsing
        //TODO Search and Favorites Selection
        //TODO Search and Favorites Paging
        //TODO Search and Paging Saving (Separate and auromate)

        public MainWindowConnector(IListManager listManager, IEventSystem eventSystem, IAppStates appStatem,
                                   OperationManager manager, FilesManager filesManager, ImageManager imageManager) : base(listManager, eventSystem)
        {
            _appStatem = appStatem;

            ReactOn <PrepareLoadEvent>(_ => FileListIndex = 0);
            ReactOn <PostLoadingEvent>(e => _appStatem.Set <GlobalAppState>(s => s.LastLocation = e.Path));
            DisposeThis(filesManager.FilterObservable.Subscribe(_ => FileListIndex = 1));

            OperationManager   = manager;
            FilesManager       = filesManager;
            ImageManager       = imageManager;
            WindowState        = new UIWindowState(_appStatem);
            _fullScreenManager = new FullScreenManager(WindowState);

            OpenLocationCommand = BindToEvent(OpenLocation);
            NextImage           = BindToEvent(_ => new NextPageEvnt(false));
            BackImage           = BindToEvent(_ => new NextPageEvnt(true));
            DeleteCommand       = BindToEvent(
                _ => MessageBox.Show("Wírklich Löschen?", "Löschen", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes
                    ? new DeleteEvent(ImageManager.CurrentIndex)
                    : null);
            ToogleFavoriteCommand = BindToEvent(_ => new ToogleFavoritesEvent(ImageManager.CurrentIndex));

            FullScreen = new DelegateCommand(_ => _fullScreenManager.EnableFullScreen(), _ => true);
        }
Exemplo n.º 2
0
 public void defaultDragAction(int mouse)
 {
     position = mouseOffset + root.mousePos;
     if (mouse == 3)
     {
         state = UIWindowState.Neutral;
     }
 }
Exemplo n.º 3
0
 /**
  * Callback functions.. may need to refactor?
  */
 virtual public void menuPressed_func(Vector2 pos, object obj, int mouse)
 {
     if (mouse == 1)
     {
         state       = UIWindowState.Dragging;
         mouseOffset = GlobalPosition - pos;
         Console.WriteLine("succ");
     }
 }
Exemplo n.º 4
0
 public void TrySwitchTo(UIWindowState new_state)
 {
   fsm.TrySwitchTo(new_state);
 }