コード例 #1
0
        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);
            }
        }
コード例 #2
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());
            }
        }
コード例 #3
0
        private void HandleEdit()
        {
            if (SelectedItem != null)
            {
                SourcePortEditForm editForm   = new SourcePortEditForm(m_adapter, m_tabViews, m_launchType);
                ISourcePort        sourcePort = SelectedItem;
                editForm.SetDataSource(sourcePort);
                editForm.StartPosition = FormStartPosition.CenterParent;

                if (editForm.ShowDialog(this) == DialogResult.OK)
                {
                    editForm.UpdateDataSource(sourcePort);
                    m_adapter.UpdateSourcePort(sourcePort);
                    ResetData();
                }
            }
        }
コード例 #4
0
 private void HandleEdit()
 {
     if (this.SelectedItem != null)
     {
         SourcePortEditForm form = new SourcePortEditForm();
         form.Initialize(this.DataAdapter, this.m_tabViews);
         ISourcePortDataSource selectedItem = this.SelectedItem;
         form.SetDataSource(selectedItem);
         form.StartPosition = FormStartPosition.CenterParent;
         form.Initialize(this.DataAdapter, this.m_tabViews);
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             form.UpdateDataSource(selectedItem);
             this.DataAdapter.UpdateSourcePort(selectedItem);
             this.SetDataSource(this.DataAdapter.GetSourcePorts());
         }
     }
 }
コード例 #5
0
        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();
            }
        }