private void btnNew_Click(object sender, EventArgs e)
        {
            SourcePortEditForm editForm = new SourcePortEditForm(m_adapter, m_tabViews, m_launchType);

            IEnumerable <string> extensions = new string[] { ".wad" };

            if (m_launchType == SourcePortLaunchType.SourcePort)
            {
                extensions = extensions.Union(Util.GetDehackedExtensions().Union(Util.GetSourcePortPkExtensions()));
            }
            else
            {
                extensions = extensions.Union(Util.GetSourcePortPkExtensions());
            }

            editForm.SetSupportedExtensions(string.Join(",", extensions));

            editForm.StartPosition = FormStartPosition.CenterParent;

            if (editForm.ShowDialog(this) == DialogResult.OK)
            {
                SourcePortData sourcePort = new SourcePortData();
                editForm.UpdateDataSource(sourcePort);
                sourcePort.LaunchType = m_launchType;
                m_adapter.InsertSourcePort(sourcePort);
                ResetData();

                SelectSourcePort(sourcePort);
            }
        }
        private void btnNew_Click(object sender, EventArgs e)
        {
            SourcePortEditForm editForm = new SourcePortEditForm(m_adapter, m_tabViews, m_launchType);

            if (m_launchType == SourcePortLaunchType.SourcePort)
            {
                editForm.SetSupportedExtensions(string.Format(".wad,{0},.deh,.bex", Util.GetPkExtensionsCsv()));
            }
            else
            {
                editForm.SetSupportedExtensions(string.Format(".wad,{0}", Util.GetPkExtensionsCsv()));
            }

            editForm.StartPosition = FormStartPosition.CenterParent;

            if (editForm.ShowDialog(this) == DialogResult.OK)
            {
                SourcePort sourcePort = new SourcePort();
                editForm.UpdateDataSource(sourcePort);
                sourcePort.LaunchType = m_launchType;
                m_adapter.InsertSourcePort(sourcePort);
                ResetData();
            }
        }
Пример #3
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            SourcePortEditForm form = new SourcePortEditForm();

            form.Initialize(this.DataAdapter, this.m_tabViews);
            form.SetSupportedExtensions(".wad,.pk3,.pk7,.deh,.bex");
            form.StartPosition = FormStartPosition.CenterParent;
            form.StartPosition = FormStartPosition.CenterParent;
            if (form.ShowDialog(this) == DialogResult.OK)
            {
                SourcePortDataSource ds = new SourcePortDataSource();
                form.UpdateDataSource(ds);
                this.DataAdapter.InsertSourcePort(ds);
                this.SetDataSource(this.DataAdapter.GetSourcePorts());
            }
        }