Exemplo n.º 1
0
        public void SetMediaListController(MediaListController mlc)
        {
            mediaListController = mlc;
            imageViewItems.Clear();
            
            mediaListController.VisitAll(m => imageViewItems.Add(new ImageViewItem(m)));

            imageView.ReloadData();
        }
Exemplo n.º 2
0
		// Shared initialization code
		void Initialize()
		{
			mediaListController = new DirectoryController(this, FileListUpdated);
			SupportedFileTypes.Add("com.adobe.pdf");
		}
Exemplo n.º 3
0
		public bool OpenFolderOrFiles(string[] paths)
		{
			string filename = null;
			if (File.Exists(paths[0]))
			{
				filename = paths[0];

                if (paths.Length == 1)
                {
                    paths[0] = Path.GetDirectoryName(filename);
                }
			}

            ShowBusy();
            var dirController = mediaListController as DirectoryController;
            if (dirController == null)
            {
                dirController = new DirectoryController(this, FileListUpdated);
                mediaListController = dirController;
            }

            logger.Info("Open '{0}'", String.Join("', '", paths));
			dirController.Scan(paths);
			mediaListController.SelectFile(filename);
			ShowFile();

            // HACK: I don't understand the white band that shows below the image view and above the status view.
            // Causing the window to resize or hiding/showing the view forces it to redo whatever is needed. ???
            imageView.Hidden = true;
            imageView.Hidden = false;

            ThumbController.SetMediaListController(mediaListController);

			// That's gross - Mono exposes SharedDocumentController as NSObject rather than NSDocumentcontroller
			(NSDocumentController.SharedDocumentController as NSDocumentController).NoteNewRecentDocumentURL(new NSUrl(paths[0], false));

            HideBusy();

			return true;
		}