コード例 #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
ファイル: AddPicturesTask.cs プロジェクト: sillsdev/wesay
 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
ファイル: SidebarAdapter.cs プロジェクト: vkarthim/FieldWorks
        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
ファイル: PanelButton.cs プロジェクト: bbriggs/FieldWorks
		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
ファイル: PanelMenu.cs プロジェクト: sillsdev/FieldWorks
		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
ファイル: SidebarAdapter.cs プロジェクト: bbriggs/FieldWorks
		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
ファイル: DbImageRepository.cs プロジェクト: emtees/old-code
	// IImageRepository
	public void DeleteCollection (IImageCollection theColl)
	{
		if (theColl.Repo != this) {
			throw new InvalidOperationException ();
		}

		DeleteCollection (Convert.ToInt32 (theColl.ID));
	}
コード例 #35
0
ファイル: DirImageRepository.cs プロジェクト: emtees/old-code
	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
ファイル: PaneBar.cs プロジェクト: bbriggs/FieldWorks
		/// <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
ファイル: ReBarAdapter.cs プロジェクト: bbriggs/FieldWorks
		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
ファイル: MphotoToplevel.cs プロジェクト: emtees/old-code
//    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;
	}
コード例 #44
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
ファイル: AdapterBase.cs プロジェクト: bbriggs/FieldWorks
		/// <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
ファイル: PaneBar.cs プロジェクト: bbriggs/FieldWorks
		/// <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));
		}
	}