Problem OpenFileDialog

89 views
Skip to first unread message

Rafael Vasco

unread,
Jul 2, 2015, 3:14:49 PM7/2/15
to eto-...@googlegroups.com
Doing this:

opfDialog = new OpenFileDialog()
            {
                Title = "Select Image to Load",
                Filters =
                {
                    new FileDialogFilter("Image Files (.png)", ".png")
                }
            };


'System.Collections.Generic.IEnumerable<Eto.Forms.IFileDialogFilter>' does not contain a definition for 'Add'. 

Took this example from the repo. 

Using 2.0.7 

Do i need a newer version of Eto ? 

curtis

unread,
Jul 2, 2015, 3:56:33 PM7/2/15
to eto-...@googlegroups.com, rafael...@gmail.com
Hi Rafael,

Yeah, sorry - that sample is for the develop branch (soon to be 2.1) which has an updated api to make it more consistent with the rest of the framework.  In 2.0.7, you can add 'new []' like so:

var opfDialog = new OpenFileDialog()

{
   
Title = "Select Image to Load",

   
Filters = new []

   
{
       
new FileDialogFilter("Image Files (.png)", ".png")
   
}
};


Hope this helps!
Curtis.

Rafael Vasco

unread,
Jul 2, 2015, 3:59:34 PM7/2/15
to eto-...@googlegroups.com, rafael...@gmail.com
Ah yes. Imagined that. Thanks again !

keith....@gmail.com

unread,
Jun 26, 2017, 1:56:29 AM6/26/17
to Eto.Forms
Hi Curtis, Can you also show the python version of this ? thx Keith
Reply all
Reply to author
Forward
0 new messages