Пример #1
0
    void CollectionChanged(IImageCollection coll, EventArgs ea)
    {
        Console.WriteLine("collectionChanged! " + coll.ID);
        Gtk.TreeIter iter = new Gtk.TreeIter();
        bool         valid;

        valid = this.GetIterFirst(out iter);
        while (valid)
        {
            GLib.Value gv = new GLib.Value();
            this.GetValue(iter, (int)ColNames.InternalIDCol, ref gv);
            if ((string)gv == coll.ID)
            {
                // match
                break;
            }

            valid = this.IterNext(ref iter);
        }

        if (valid)
        {
            this.SetValue(iter, (int)ColNames.NameCol, new GLib.Value(coll.Name));
            this.SetValue(iter, (int)ColNames.CountCol, new GLib.Value(coll.Count));
        }
    }
Пример #2
0
        private void InnerSingleFile(string input, string output)
        {
            var inPath  = input;
            var outPath = output;

            logger.Information($"Processing file {input}");
            using (IImageCollection collection = imageFactory.Create(inPath))
            {
                var imageBuilder = new FoDicomImageBuilder()
                                   .FromImageCollection(collection)
                                   .WithDefaultPatientData();

                for (int i = 0; i < collection.Data.Count; i++)
                {
                    logger.Information($"Adding frame {i + 1} of {collection.Data.Count}");
                    var byteData = collection.Data[i].GetPixels().ToByteArray(PixelMapping.RGB);

                    imageBuilder.AddImage(byteData);
                }

                var image = imageBuilder.Build();
                image.Save(outPath);
            }

            logger.Information($"File successfully written to {outPath}");
            logger.Information("Press any key to exit...");
            Console.ReadLine();
        }
Пример #3
0
 ///  <summary>
 ///
 ///  </summary>
 ///  <param name="smallImages"></param>
 /// <param name="menuBarAdapter"></param>
 /// <param name="mediator"></param>
 /// <returns></returns>
 public void Init(IImageCollection smallImages, IUIMenuAdapter menuBarAdapter, Mediator mediator)
 {
     m_mediator = mediator;
     mediator.AddColleague(this);
     m_smallImages    = smallImages;
     m_menuBarAdapter = menuBarAdapter;
 }
Пример #4
0
 public override void Activate()
 {
     base.Activate();
     _imageCollection = ArtOfReadingImageCollection.FromStandardLocations();
     if (_imageCollection == null)
     {
         throw new ConfigurationException("Could not locate image index.");
     }
 }
Пример #5
0
        public System.Windows.Forms.Control Init(System.Windows.Forms.Form window, IImageCollection smallImages, IImageCollection largeImages, Mediator mediator)
        {
            m_window      = window;
            m_smallImages = smallImages;
            m_largeImages = largeImages;
            m_menuBar     = new CommandBar(CommandBarStyle.Menu);

            return(null);            //this is not available yet. caller should call GetCommandBarManager() after CreateUIForChoiceGroupCollection() is called
        }
Пример #6
0
		public System.Windows.Forms.Control Init (System.Windows.Forms.Form window,  IImageCollection smallImages, IImageCollection largeImages, Mediator mediator)
		{
			m_window = window;
			m_smallImages = smallImages;
			m_largeImages = largeImages;
			m_menuBar = new CommandBar(CommandBarStyle.Menu);

			return null; //this is not available yet. caller should call GetCommandBarManager() after CreateUIForChoiceGroupCollection() is called
		}
Пример #7
0
    // IImageRepository
    public void DeleteCollection(IImageCollection theColl)
    {
        if (theColl.Repo != this)
        {
            throw new InvalidOperationException();
        }

        DeleteCollection(Convert.ToInt32(theColl.ID));
    }
Пример #8
0
        public FoDicomImageBuilder FromImageCollection(IImageCollection imageCollection)
        {
            int width  = imageCollection.Width;
            int height = imageCollection.Height;

            this.DataSet   = this.ConfigureDataSet(width, height);
            this.PixelData = this.CreatePixelData(width, height);

            return(this);
        }
Пример #9
0
//    public Glade.XML GladeXML {
//        get {
//            return gxml;
//        }
//    }

    public void SelectCollection(IImageCollection c)
    {
        collection = c;
        if (icon_list != null)
        {
            icon_list.Adapter = new CollectionIconListAdapter(collection);
        }

        top_level_notebook.CurrentPage = 0;
    }
Пример #10
0
    public void on_new_collection_activate(object o, EventArgs ea)
    {
        if (repo == null)
        {
            return;
        }

        IImageCollection c = repo.CreateCollection();

        SelectCollection(c);
    }
Пример #11
0
    public void on_ncollection_activate(object o, EventArgs ea)
    {
        Console.WriteLine("ncoll");
        if (repo == null)
        {
            return;
        }

        IImageCollection c = repo.CreateCollection();

        SelectCollection(c);
    }
Пример #12
0
 /// <summary>
 /// Initializes the adapter.
 /// </summary>
 /// <param name="window">The main form.</param>
 /// <param name="smallImages">Collection of small images.</param>
 /// <param name="largeImages">Collection of large images.</param>
 /// <param name="mediator">XCore Mediator.</param>
 /// <returns>A Control for use by client.</returns>
 public virtual System.Windows.Forms.Control Init(System.Windows.Forms.Form window,
                                                  IImageCollection smallImages, IImageCollection largeImages, Mediator mediator)
 {
     m_window      = window;
     m_smallImages = smallImages;
     m_largeImages = largeImages;
     m_mediator    = mediator;
     if (this is IxCoreColleague)
     {
         ((IxCoreColleague)this).Init(mediator, null /*I suppose we could get these to the adapter if someone needs that someday*/);
     }
     return(MyControl);
 }
Пример #13
0
    public void CollectionsTreeViewActivateHandler(object o, RowActivatedArgs row_act_args)
    {
        string           collid = collections_tree_view.Store.GetCollectionAtPath(row_act_args.Path);
        IImageCollection coll   = repo.GetCollection(collid);

        if (coll == null)
        {
            Console.WriteLine("collection " + collid + " not found ");
            return;
        }

        SelectCollection(coll);
    }
Пример #14
0
    private void DoRealImport(string uri, IImageRepository repo, IImageCollection coll)
    {
        if (!CanImportUri(uri))
        {
            throw new InvalidOperationException();
        }
        DirectoryInfo sourcedir = new DirectoryInfo(uri);

        FileInfo[] finfos = sourcedir.GetFiles();

        if (coll != null)
        {
            coll.FreezeUpdates();
        }

        foreach (FileInfo fi in finfos)
        {
            string lf = fi.FullName.ToLower();
            if (lf.EndsWith(".jpg") ||
                lf.EndsWith(".jpeg") ||
                lf.EndsWith(".png") ||
                lf.EndsWith(".gif") ||
                lf.EndsWith(".tif") ||
                lf.EndsWith(".tiff"))
            {
//                int[] wh = GetImageDimensions (fi.FullName);

                ImageItem.ImageInfo iinfo = new ImageItem.ImageInfo();
//                iinfo.width = wh[0];
//                iinfo.height = wh[1];
                iinfo.width    = 0;
                iinfo.height   = 0;
                iinfo.filesize = (int)fi.Length;

                iinfo.dirname  = uri;
                iinfo.filename = fi.Name;

                ImageItem iitem = new ImageItem(iinfo);
                iitem = repo.AddImage(iitem);
                if (coll != null)
                {
                    coll.AddItem(iitem);
                }
            }
        }

        if (coll != null)
        {
            coll.ThawUpdates();
        }
    }
Пример #15
0
	public CollectionIconListAdapter (IImageCollection coll)
	{
		icon_list = null;
		collection = coll;
		image_ids = new ArrayList ();
		image_id_to_index = new Hashtable ();

		if (coll != null) {
			repo = coll.Repo;

			UpdateFromCollection ();
			coll.OnCollectionChange += new CollectionChangeHandler (CollectionChanged);
		}
	}
Пример #16
0
    public CollectionIconListAdapter(IImageCollection coll)
    {
        icon_list         = null;
        collection        = coll;
        image_ids         = new ArrayList();
        image_id_to_index = new Hashtable();

        if (coll != null)
        {
            repo = coll.Repo;

            UpdateFromCollection();
            coll.OnCollectionChange += new CollectionChangeHandler(CollectionChanged);
        }
    }
Пример #17
0
        public System.Windows.Forms.Control Init(System.Windows.Forms.Form window, IImageCollection smallImages, IImageCollection largeImages, Mediator mediator)
        {
            m_mediator    = mediator;
            m_smallImages = smallImages;
            m_largeImages = largeImages;

            // Create controls
            m_bar       = new OutlookBar();
            m_bar.Dock  = DockStyle.Left;
            m_bar.Width = 140;

            //m_bar.ItemDropped +=(new SidebarLibrary.WinControls.OutlookBarItemDroppedHandler(TabOpened));
            m_bar.ItemClicked     += (new SidebarLibrary.WinControls.OutlookBarItemClickedHandler(OnItemClicked));
            m_bar.PropertyChanged += (new SidebarLibrary.WinControls.OutlookBarPropertyChangedHandler(PropertyChanged));
            return(m_bar);
        }
Пример #18
0
        private void ArtOfReadingChooser_Load(object sender, EventArgs e)
        {
            if (DesignMode)
            {
                return;
            }

            _imageCollection = ArtOfReadingImageCollection.FromStandardLocations();
            if (_imageCollection == null)
            {
                //label1.Visible = _searchTermsBox.Visible = _searchButton.Visible = _thumbnailViewer.Visible = false;
                _messageLabel.Visible = true;
                _messageLabel.Font    = new Font(SystemFonts.DialogFont.FontFamily, 10);
                _messageLabel.Text    = @"This computer doesn't appear to have the 'International Illustrations: the Art Of Reading' gallery installed yet.";
                // Adjust size to avoid text truncation
                _messageLabel.Size       = new Size(400, 100);
                betterLinkLabel1.Visible = true;
            }
            else
            {
#if DEBUG
                //  _searchTermsBox.Text = @"flower";
#endif
                if (string.IsNullOrEmpty(_searchTermsBox.Text))
                {
                    _messageLabel.Visible = true;
                    _messageLabel.Font    = new Font(SystemFonts.DialogFont.FontFamily, 10);
                    _messageLabel.Text    = "This is the 'Art Of Reading' gallery. In the box above, type what you are searching for, then press ENTER. You can type words in English and Indonesian.".Localize("ImageToolbox.EnterSearchTerms");
                    // Adjust size to avoid text truncation
                    _messageLabel.Height = 100;
                }
                _thumbnailViewer.SelectedIndexChanged += new EventHandler(_thumbnailViewer_SelectedIndexChanged);
            }

#if DEBUG
            if (!HaveImageCollectionOnThisComputer)
            {
                return;
            }
            //when just testing, I just want to see some choices.
            // _searchTermsBox.Text = @"flower";
            _searchButton_Click(this, null);
#endif

            _messageLabel.BackColor = Color.White;
        }
Пример #19
0
    void CollectionNameEditedHandler(object o, Gtk.EditedArgs ea)
    {
        string           collid = store.GetCollectionAtPathString(ea.Path);
        IImageCollection coll   = repo.GetCollection(collid);

        if (coll == null)
        {
            Console.WriteLine("collection " + collid + " not found ");
            return;
        }

        if (coll.Name != ea.NewText)
        {
            coll.Name = ea.NewText;
            Console.WriteLine("new name '" + ea.NewText + "' for collection '" + collid + "' set!");
        }
    }
Пример #20
0
 /// <summary>
 /// Initializes the adapter.
 /// </summary>
 /// <param name="window">The main form.</param>
 /// <param name="smallImages">Collection of small images.</param>
 /// <param name="largeImages">Collection of large images.</param>
 /// <param name="mediator">XCore Mediator.</param>
 /// <param name="propertyTable"></param>
 /// <returns>A Control for use by client.</returns>
 public virtual Control Init(Form window,
                             IImageCollection smallImages, IImageCollection largeImages, Mediator mediator, PropertyTable propertyTable)
 {
     m_window      = window;
     m_smallImages = smallImages;
     m_largeImages = largeImages;
     if (this is IxCoreColleague)
     {
         ((IxCoreColleague)this).Init(mediator, propertyTable, null /*I suppose we could get the config node to the adapter if someone needs that someday*/);
     }
     else
     {
         m_mediator      = mediator;
         m_propertyTable = propertyTable;
     }
     return(MyControl);
 }
Пример #21
0
 /// <summary>
 /// METHOD: Initialise, a method which initialises the Controller
 /// </summary>
 public void Initialise()
 {
     // INSTANTIATE _collectionView
     _collectionView = new CollectionView(AddImage);
     // _imgManipulator as new ImageManipulator
     _imgManipulator = new ImageManipulator();
     // INSTANTIATE _fileDialog
     _fileDialog = new OpenFileDialog();
     // INSTANTIATE _dvController as a new DisplayViewController
     _dvController = new DisplayViewController(Execute);
     // _imgCollection as new ImageCollection
     _imgCollection = new ImageCollection(_dvController.InitialiseDisplay);
     // SET multiselection on the file dialog to true
     _fileDialog.Multiselect = true;
     // RUN the the new collection view
     Application.Run(_collectionView);
 }
Пример #22
0
    public void Refresh()
    {
        this.Clear();

        if (repo != null)
        {
            Gtk.TreeIter iter = new Gtk.TreeIter();
            foreach (string coll_id in repo.GetCollectionIDs())
            {
                IImageCollection icoll = repo.GetCollection(coll_id);
                iter = this.Append();

                this.SetValue(iter, (int)ColNames.NameCol, new GLib.Value(icoll.Name));
                this.SetValue(iter, (int)ColNames.CountCol, new GLib.Value(icoll.Count));
                this.SetValue(iter, (int)ColNames.InternalIDCol, new GLib.Value(icoll.ID));
            }
        }
    }
Пример #23
0
        public MainWindow()
        {
            ClassDir.SettingsManager.CheckSettings(); // ???

            ImageCollection = new ImageCollection(CacheFile, Interfaces.Size.SMALL);
            AlbumsManager   = new AlbumManager(CacheFile);

            Scrolled += ImageCollection.ScrolledEventHandler;
            Resized  += ImageCollection.ResizedEventHandler;

            CurrentAlbumChanged += MainWindow_CurrentAlbumChanged;

            _resizeTimer.Tick      += _resizeTimer_Tick;
            _scrollDelayTimer.Tick += _scrollDelayTimer_Tick;

            InitializeComponent();

            AlbumsButtonsRenderer(AlbumsManager.Albums);
        }
Пример #24
0
	private void DoRealImport (string uri, IImageRepository repo, IImageCollection coll)
	{
		if (!CanImportUri (uri)) {
			throw new InvalidOperationException ();
		}
		DirectoryInfo sourcedir = new DirectoryInfo (uri);
		FileInfo[] finfos = sourcedir.GetFiles ();

		if (coll != null)
			coll.FreezeUpdates ();

		foreach (FileInfo fi in finfos) {
			string lf = fi.FullName.ToLower ();
			if (lf.EndsWith (".jpg") ||
			    lf.EndsWith (".jpeg") ||
			    lf.EndsWith (".png") ||
			    lf.EndsWith (".gif") ||
			    lf.EndsWith (".tif") ||
			    lf.EndsWith (".tiff"))
			{
//                int[] wh = GetImageDimensions (fi.FullName);

				ImageItem.ImageInfo iinfo = new ImageItem.ImageInfo ();
//                iinfo.width = wh[0];
//                iinfo.height = wh[1];
				iinfo.width = 0;
				iinfo.height = 0;
				iinfo.filesize = (int) fi.Length;

				iinfo.dirname = uri;
				iinfo.filename = fi.Name;

				ImageItem iitem = new ImageItem (iinfo);
				iitem = repo.AddImage (iitem);
				if (coll != null)
					coll.AddItem (iitem);
			}
		}

		if (coll != null)
			coll.ThawUpdates ();
	}
Пример #25
0
        public IImageCollection Create(string filePath)
        {
            IImageCollection imageCollection = null;
            string           extension       = this.GetFileExtension(filePath);

            logger.Information("Detected file with extension {ext}", extension);

            switch (extension)
            {
            case ".gif":
                imageCollection = this.CreateFromGif(filePath);
                break;

            case ".mp4":
            case ".avi":
                imageCollection = this.CreateFromVideo(filePath);
                break;
            }

            return(imageCollection);
        }
Пример #26
0
        private async Task LoadSeriesAsync(DataReader reader, IImageCollection imageCollection)
        {
            await reader.LoadAsync(sizeof(int));

            var nameLength = reader.ReadUInt32();

            await reader.LoadAsync(nameLength);

            var seriesName = reader.ReadString(nameLength);

            await reader.LoadAsync(sizeof(int));

            var numImages = reader.ReadInt32();

            imageCollection.CreateSeries(seriesName, numImages);
            foreach (var position in Util.Range(numImages))
            {
                await this.LoadImageAsync(
                    reader, seriesName, position, imageCollection);
            }
        }
Пример #27
0
        public PanelButton(XCore.ChoiceBase choice, IImageCollection images) : base()
        {
            m_images = images;

            this.Dock     = System.Windows.Forms.DockStyle.Right;
            this.Font     = new System.Drawing.Font("Tahoma", 13F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.Location = new System.Drawing.Point(576, 2);
            this.Name     = "panelEx1";
            this.Anchor   = System.Windows.Forms.AnchorStyles.None;
            this.Size     = new System.Drawing.Size(120, 20);

            this.MouseEnter += new EventHandler(panelButton_MouseEnter);
            this.MouseLeave += new EventHandler(panelButton_MouseLeave);
            this.MouseDown  += new MouseEventHandler(panelButton_MouseDown);

            this.Click   += new EventHandler(PanelButton_Click);
            this.TabIndex = 0;

            this.Tag = choice;
            SetLabel();
        }
Пример #28
0
		public PanelButton(XCore.ChoiceBase choice, IImageCollection images):base()
		{
			m_images = images;

			this.Dock = System.Windows.Forms.DockStyle.Right;
			this.Font = new System.Drawing.Font("Tahoma", 13F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.Location = new System.Drawing.Point(576, 2);
			this.Name = "panelEx1";
			this.Anchor = System.Windows.Forms.AnchorStyles.None;
			this.Size = new System.Drawing.Size(120, 20);

			this.MouseEnter += new EventHandler(panelButton_MouseEnter);
			this.MouseLeave += new EventHandler(panelButton_MouseLeave);
			this.MouseDown += new MouseEventHandler(panelButton_MouseDown);

			this.Click += new EventHandler(PanelButton_Click);
			this.TabIndex = 0;

			this.Tag = choice;
			SetLabel();
		}
Пример #29
0
		public PanelMenu(XCore.ChoiceGroup group, IImageCollection images, XCore.IUIMenuAdapter menuBarAdapter):base()
		{
			m_group = group;
			m_images = images;
			m_menuBarAdapter = menuBarAdapter;

			this.Dock = System.Windows.Forms.DockStyle.Right;
			this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.Location = new System.Drawing.Point(576, 2);
			this.Name = "panel1";
			this.Anchor = System.Windows.Forms.AnchorStyles.None;
			this.Size = new System.Drawing.Size(16, 16);


			this.Click +=new EventHandler(PanelMenu_Click);
			this.TabIndex = 0;

			//	this.Click += new EventHandler(m_infoBarButton_Click);
			this.Tag = group;

			Display();
			//	UpdateInfoBarButtonImage();
		}
Пример #30
0
        public PanelMenu(XCore.ChoiceGroup group, IImageCollection images, XCore.IUIMenuAdapter menuBarAdapter) : base()
        {
            m_group          = group;
            m_images         = images;
            m_menuBarAdapter = menuBarAdapter;

            this.Dock     = System.Windows.Forms.DockStyle.Right;
            this.Font     = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.Location = new System.Drawing.Point(576, 2);
            this.Name     = "panel1";
            this.Anchor   = System.Windows.Forms.AnchorStyles.None;
            this.Size     = new System.Drawing.Size(16, 16);


            this.Click   += new EventHandler(PanelMenu_Click);
            this.TabIndex = 0;

            //	this.Click += new EventHandler(m_infoBarButton_Click);
            this.Tag = group;

            Display();
            //	UpdateInfoBarButtonImage();
        }
Пример #31
0
        private async Task LoadImageAsync(DataReader reader, string seriesName, int position, IImageCollection imageCollection)
        {
            await reader.LoadAsync(sizeof(int) * 2 + sizeof(uint));

            var width        = reader.ReadInt32();
            var height       = reader.ReadInt32();
            var bufferLength = reader.ReadUInt32();

            await reader.LoadAsync(bufferLength);

            var imageBytes = new byte[bufferLength];

            reader.ReadBytes(imageBytes);

            imageCollection.AddImageToSeries(
                new ImageTransferObject()
            {
                Image    = imageBytes,
                Series   = seriesName,
                Position = position,
                Width    = width,
                Height   = height
            });
            this.OnLoadedImage();
        }
Пример #32
0
 void CollectionChanged(IImageCollection coll, EventArgs unused)
 {
     UpdateFromCollection();
 }
Пример #33
0
		public System.Windows.Forms.Control Init(System.Windows.Forms.Form window, IImageCollection smallImages, IImageCollection largeImages, Mediator mediator)
		{
			m_mediator = mediator;
			m_smallImages= smallImages;
			m_largeImages= largeImages;

			// Create controls
			m_bar = new OutlookBar();
			m_bar.Dock = DockStyle.Left;
			m_bar.Width = 140;

			//m_bar.ItemDropped +=(new SidebarLibrary.WinControls.OutlookBarItemDroppedHandler(TabOpened));
			m_bar.ItemClicked +=(new SidebarLibrary.WinControls.OutlookBarItemClickedHandler(OnItemClicked));
			m_bar.PropertyChanged +=(new SidebarLibrary.WinControls.OutlookBarPropertyChangedHandler(PropertyChanged));
			return m_bar;
		}
Пример #34
0
	// IImageRepository
	public void DeleteCollection (IImageCollection theColl)
	{
		if (theColl.Repo != this) {
			throw new InvalidOperationException ();
		}

		DeleteCollection (Convert.ToInt32 (theColl.ID));
	}
Пример #35
0
	public void DeleteCollection (IImageCollection theColl) 
	{
		throw new InvalidOperationException ();
	}
Пример #36
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="smallImages"></param>
 /// <param name="mediator"></param>
 /// <returns></returns>
 public void  Init(IImageCollection smallImages, IUIMenuAdapter menuBarAdapter, Mediator mediator)
 {
 }
Пример #37
0
		private void ArtOfReadingChooser_Load(object sender, EventArgs e)
		{
			if (DesignMode)
				return;

			_imageCollection = ArtOfReadingImageCollection.FromStandardLocations(SearchLanguage);
			if (_imageCollection == null)
			{
				_messageLabel.Visible = true;
				_messageLabel.Text = "This computer doesn't appear to have the 'Art Of Reading' gallery installed yet.".Localize("ImageToolbox.NoArtOfReading");
				// Adjust size to avoid text truncation
				_messageLabel.Size = new Size(400,100);
				_downloadInstallerLink.Visible = true;
			}
			else
			{
#if DEBUG
				//  _searchTermsBox.Text = @"flower";
#endif
				SetupSearchLanguageChoice();
				_messageLabel.Visible = string.IsNullOrEmpty(_searchTermsBox.Text);
				// Adjust size to avoid text truncation
				_messageLabel.Height = 200;
				SetMessageLabelText();
				_thumbnailViewer.SelectedIndexChanged += new EventHandler(_thumbnailViewer_SelectedIndexChanged);
			}
			_messageLabel.Font = new Font(SystemFonts.DialogFont.FontFamily, 10);

#if DEBUG
			//if (!HaveImageCollectionOnThisComputer)
			//	return;
			//when just testing, I just want to see some choices.
			// _searchTermsBox.Text = @"flower";
			//_searchButton_Click(this,null);
#endif
		}
Пример #38
0
		public PictureChooser(IImageCollection images, string searchWords)
		{
			_images = images;
			InitializeComponent();
			_searchTermsBox.Text = searchWords;
		}
Пример #39
0
		/// <summary>
		///
		/// </summary>
		/// <param name="smallImages"></param>
		/// <param name="mediator"></param>
		/// <returns></returns>
		public void  Init (IImageCollection smallImages, IUIMenuAdapter menuBarAdapter, Mediator mediator)
		{
			m_mediator = mediator;
			mediator.AddColleague(this);
			m_smallImages = smallImages;
			m_menuBarAdapter = menuBarAdapter;
		}
Пример #40
0
		public System.Windows.Forms.Control Init (System.Windows.Forms.Form window,  IImageCollection smallImages, IImageCollection largeImages, Mediator mediator)
		{
			m_window = window;
			m_smallImages = smallImages; m_largeImages = largeImages;
			return null;
		}
Пример #41
0
 public PictureChooser(IImageCollection images, string searchWords)
 {
     _images = images;
     InitializeComponent();
     _searchTermsBox.Text = searchWords;
 }
Пример #42
0
	public void ImportUri (string uri, IImageCollection coll)
	{
		DoRealImport (uri, coll.Repo, coll);
	}
Пример #43
0
//    public Glade.XML GladeXML {
//        get {
//            return gxml;
//        }
//    }

	public void SelectCollection (IImageCollection c)
	{
		collection = c;
		if (icon_list != null) {
			icon_list.Adapter = new CollectionIconListAdapter (collection);
		}
        
		top_level_notebook.CurrentPage = 0;
	}
        private void ArtOfReadingChooser_Load(object sender, EventArgs e)
        {
            if (DesignMode)
                return;

            _imageCollection = ArtOfReadingImageCollection.FromStandardLocations();
            if (_imageCollection == null)
            {
                //label1.Visible = _searchTermsBox.Visible = _searchButton.Visible = _thumbnailViewer.Visible = false;
                _messageLabel.Visible = true;
                _messageLabel.Font = new Font(SystemFonts.DialogFont.FontFamily, 10);
                _messageLabel.Text = @"This computer doesn't appear to have the 'International Illustrations: the Art Of Reading' gallery installed yet.";
                betterLinkLabel1.Visible = true;
            }
            else
            {
            #if DEBUG
                //  _searchTermsBox.Text = @"flower";
            #endif
                _thumbnailViewer.SelectedIndexChanged += new EventHandler(_thumbnailViewer_SelectedIndexChanged);
            }

            #if DEBUG
            if (!HaveImageCollectionOnThisComputer)
                return;
            //when just testing, I just want to see some choices.
               // _searchTermsBox.Text = @"flower";
            _searchButton_Click(this,null);
            #endif

            _messageLabel.BackColor = Color.White;
            _searchTermsBox.Focus();
        }
Пример #45
0
 public void ImportUri(string uri, IImageCollection coll)
 {
     DoRealImport(uri, coll.Repo, coll);
 }
Пример #46
0
		/// <summary>
		/// Initializes the adapter.
		/// </summary>
		/// <param name="window">The main form.</param>
		/// <param name="smallImages">Collection of small images.</param>
		/// <param name="largeImages">Collection of large images.</param>
		/// <param name="mediator">XCore Mediator.</param>
		/// <returns>A Control for use by client.</returns>
		public virtual System.Windows.Forms.Control Init(System.Windows.Forms.Form window,
			IImageCollection smallImages, IImageCollection largeImages, Mediator mediator)
		{
			m_window = window;
			m_smallImages = smallImages;
			m_largeImages = largeImages;
			m_mediator = mediator;
			if(this is IxCoreColleague)
				((IxCoreColleague)this).Init(mediator, null/*I suppose we could get these to the adapter if someone needs that someday*/);
			return MyControl;
		}
Пример #47
0
	void CollectionChanged (IImageCollection coll, EventArgs unused)
	{
		UpdateFromCollection ();
	}
Пример #48
0
		private void ArtOfReadingChooser_Load(object sender, EventArgs e)
		{
			if (DesignMode)
				return;

			_imageCollection = ArtOfReadingImageCollection.FromStandardLocations();
			if (_imageCollection == null)
			{
				//label1.Visible = _searchTermsBox.Visible = _searchButton.Visible = _thumbnailViewer.Visible = false;
				_messageLabel.Visible = true;
				_messageLabel.Font = new Font(SystemFonts.DialogFont.FontFamily, 10);
				_messageLabel.Text = @"This computer doesn't appear to have the 'International Illustrations: the Art Of Reading' gallery installed yet.";
				// Adjust size to avoid text truncation
				_messageLabel.Size = new Size(400,100);
				betterLinkLabel1.Visible = true;
			}
			else
			{
#if DEBUG
				//  _searchTermsBox.Text = @"flower";
#endif
				if (string.IsNullOrEmpty(_searchTermsBox.Text))
				{
					_messageLabel.Visible = true;
					_messageLabel.Font = new Font(SystemFonts.DialogFont.FontFamily, 10);
					_messageLabel.Text = "This is the 'Art Of Reading' gallery. In the box above, type what you are searching for, then press ENTER. You can type words in English and Indonesian.".Localize("ImageToolbox.EnterSearchTerms");
					// Adjust size to avoid text truncation
					_messageLabel.Height = 100;
				}
				_thumbnailViewer.SelectedIndexChanged += new EventHandler(_thumbnailViewer_SelectedIndexChanged);
			}

#if DEBUG
			if (!HaveImageCollectionOnThisComputer)
				return;
			//when just testing, I just want to see some choices.
		   // _searchTermsBox.Text = @"flower";
			_searchButton_Click(this,null);
#endif

			_messageLabel.BackColor = Color.White;
		}
Пример #49
0
		/// <summary>
		///
		/// </summary>
		/// <param name="smallImages"></param>
		/// <param name="mediator"></param>
		/// <returns></returns>
		public void  Init (IImageCollection smallImages,  IUIMenuAdapter menuBarAdapter, Mediator mediator)
		{
		}
Пример #50
0
	void CollectionChanged (IImageCollection coll, EventArgs ea)
	{
		Console.WriteLine ("collectionChanged! " + coll.ID);
		Gtk.TreeIter iter = new Gtk.TreeIter ();
		bool valid;

		valid = this.GetIterFirst (out iter);
		while (valid) {
			GLib.Value gv = new GLib.Value ();
			this.GetValue (iter, (int) ColNames.InternalIDCol, ref gv);
			if ((string) gv == coll.ID) {
				// match
				break;
			}

			valid = this.IterNext (ref iter);
		}

		if (valid) {
			this.SetValue (iter, (int) ColNames.NameCol, new GLib.Value (coll.Name));
			this.SetValue (iter, (int) ColNames.CountCol, new GLib.Value (coll.Count));
		}
	}