Esempio n. 1
0
        private void ButUpdate_Click(object sender, EventArgs e)
        {
            if (IsFormComplete)
            {
                SelectedParameter.Attributes = ParameterAttributes.None;

                var parameterDefinition = Attributes.Item as ParameterDefinition;
                if (parameterDefinition != null)
                {
                    SelectedParameter.Attributes = parameterDefinition.Attributes;
                }

                ConstantEditor.CopyStateTo(SelectedParameter);

                SelectedParameter.Name          = ItemName.Text;
                SelectedParameter.ParameterType =
                    MethodDefinition.DeclaringType.Module.Import(TypeSpecificationEditor.SelectedTypeReference);

                DialogResult = DialogResult.OK;
            }
            else
            {
                DialogResult = DialogResult.None;
            }
        }
Esempio n. 2
0
        protected ParameterDefinition CreateParameter()
        {
            ParameterDefinition prm = new ParameterDefinition(MethodDefinition.DeclaringType.Module.Import(TypeSpecificationEditor.SelectedTypeReference));

            prm.Name       = ItemName.Text;
            prm.Attributes = (Attributes.Item as ParameterDefinition).Attributes;
            ConstantEditor.CopyStateTo(prm);

            return(prm);
        }
Esempio n. 3
0
        protected ParameterDefinition CreateParameter()
        {
            var prm =
                new ParameterDefinition(CecilImporter.Import(MethodDefinition.DeclaringType.Module, TypeSpecificationEditor.SelectedTypeReference, MethodDefinition))
            {
                Name = ItemName.Text,
            };

            var attributeProvider = Attributes.Item as ParameterDefinition;

            if (attributeProvider != null)
            {
                prm.Attributes = attributeProvider.Attributes;
            }

            ConstantEditor.CopyStateTo(prm);

            return(prm);
        }