Beispiel #1
0
        private void listViewParameters_DoubleClick(object sender, EventArgs e)
        {
            if (listViewParameters.SelectedItems.Count > 0)
            {
                ListViewItem item = listViewParameters.SelectedItems[0];
                ParamData    data = (ParamData)item.Tag;

                Type baseType = data.pi.ParameterType;

                if (baseType.GetElementType() != null)
                {
                    baseType = baseType.GetElementType();
                }

                if (baseType == typeof(IStream))
                {
                    using (CreateIStreamForm frm = new CreateIStreamForm())
                    {
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            data.data = frm.Stream;
                        }
                    }
                }
                else
                {
                    using (GetTypeForm frm = new GetTypeForm(data.pi.ParameterType, data.data))
                    {
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            data.data = frm.Data;
                        }
                    }
                }

                RefreshParameters();
            }
        }
        private void listViewParameters_DoubleClick(object sender, EventArgs e)
        {
            if (listViewParameters.SelectedItems.Count > 0)
            {
                ListViewItem item = listViewParameters.SelectedItems[0];
                ParamData data = (ParamData)item.Tag;

                Type baseType = data.pi.ParameterType;

                if (baseType.GetElementType() != null)
                {
                    baseType = baseType.GetElementType();
                }

                if(baseType == typeof(IStream))
                {
                    using (CreateIStreamForm frm = new CreateIStreamForm())
                    {
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            data.data = frm.Stream;
                        }
                    }
                }
                else
                {
                    using (GetTypeForm frm = new GetTypeForm(data.pi.ParameterType, data.data))
                    {
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            data.data = frm.Data;
                        }
                    }
                }

                RefreshParameters();
            }
        }