Exemple #1
0
        private void b_export_list_Click(object sender, EventArgs e)
        {
            if (ConvertProcessor.in_process)
            {
                return;
            }
            ;

            ExportersListForm form = new ExportersListForm();

            for (int op = 0; conv_core.workbench.formats.count > op; op++)
            {
                conv_core.cFormat format = conv_core.workbench.formats[op];
                if (format.has_writer)
                {
                    form.m_all_items.Add(format.name);
                }
                ;
            }
            ;

            foreach (ColumnHeader hdr in m_formats)
            {
                form.m_selected_items.Add(hdr.Text);
            }
            ;

            switch (form.ShowDialog(this))
            {
            case DialogResult.OK: {
                int hdr_id = 0;
                while (m_formats.Count > hdr_id)
                {
                    ColumnHeader hdr = m_formats[hdr_id];
                    if (0 > form.m_selected_items.FindIndex(delegate(string str){ return(hdr.Text == str); }))
                    {
                        m_formats.Remove(hdr);

                        foreach (ListViewItem li in lv_files.Items)
                        {
                            li.SubItems.RemoveAt(hdr.Index);
                        }
                        ;

                        lv_files.Columns.Remove(hdr);

                        t_mod.Enabled = true;
                    }
                    else
                    {
                        hdr_id++;
                    };
                }
                ;

                foreach (string fmt in form.m_selected_items)
                {
                    if (0 > m_formats.FindIndex(delegate(ColumnHeader hdr) { return(fmt == hdr.Text); }))
                    {
                        conv_core.cFormat format = conv_core.workbench.formats[fmt];

                        foreach (ListViewItem li in lv_files.Items)
                        {
                            ListViewItem.ListViewSubItem lsi = li.SubItems.Add(
                                Path.GetFileNameWithoutExtension(li.Text) + "." + format.ext
                                );
                            lsi.Tag = new conv_core.cImageFile(t_base_dir.Text + "\\" + lsi.Text);
                        }
                        ;

                        add_format(fmt);

                        t_mod.Enabled = true;
                    }
                    ;
                }
                ;
            } break;
            }
            ;

            form.Dispose();
        }
Exemple #2
0
        private void b_export_list_Click(object sender, EventArgs e)
        {
            if( ConvertProcessor.in_process ){
                return;
            };

            ExportersListForm form = new ExportersListForm();

            for( int op = 0; conv_core.workbench.formats.count > op; op++ ){
                conv_core.cFormat format = conv_core.workbench.formats[ op ];
                if( format.has_writer ){
                    form.m_all_items.Add( format.name );
                };
            };

            foreach( ColumnHeader hdr in m_formats ){
                form.m_selected_items.Add( hdr.Text );
            };

            switch( form.ShowDialog( this ) ){
                case DialogResult.OK:{
                    int hdr_id = 0;
                    while( m_formats.Count > hdr_id ){
                        ColumnHeader hdr = m_formats[ hdr_id ];
                        if( 0 > form.m_selected_items.FindIndex( delegate( string str ){ return hdr.Text == str; } ) ){
                            m_formats.Remove( hdr );

                            foreach( ListViewItem li in lv_files.Items ){
                                li.SubItems.RemoveAt( hdr.Index );
                            };

                            lv_files.Columns.Remove( hdr );

                            t_mod.Enabled = true;
                        }else{
                            hdr_id++;
                        };
                    };

                    foreach( string fmt in form.m_selected_items ){
                        if( 0 > m_formats.FindIndex( delegate( ColumnHeader hdr ) { return fmt == hdr.Text; } ) ){
                            conv_core.cFormat format = conv_core.workbench.formats[ fmt ];

                            foreach( ListViewItem li in lv_files.Items ){
                                ListViewItem.ListViewSubItem lsi = li.SubItems.Add(
                                    Path.GetFileNameWithoutExtension( li.Text ) + "." + format.ext
                                );
                                lsi.Tag = new conv_core.cImageFile( t_base_dir.Text + "\\" + lsi.Text );
                            };

                            add_format( fmt );

                            t_mod.Enabled = true;
                        };
                    };
                }break;
            };

            form.Dispose();
        }