Exemplo n.º 1
0
        //Browse files functions
        private void browseFilesButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Title       = "Open textures or meshes";
            dialog.Filter      = "Textures and Meshes|*.tif; *.jpg; *.png; *.bmp; *.fbx; *.dae; *.tga; *.psd"; //Supported files
            dialog.Multiselect = true;
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    string[] files = dialog.FileNames;
                    foreach (string file in files)
                    {
                        if (file != null)
                        {
                            Framework.Log("File selected from dialog: " + file);
                            Framework.BeginImport(file, m_customOutput);
                        }
                    }
                }
                catch (Exception ex)
                {
                    Framework.ShowError("Cannot read the file from the disk");
                }
            }
        }
Exemplo n.º 2
0
        void MainWindow_DragDrop(object sender, DragEventArgs e)
        {
            //Multi-files support
            string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);

            foreach (string file in files)
            {
                Framework.BeginImport(file, m_customOutput);
            }
        }