Пример #1
0
        /// <exception cref="BadSyntaxException">
        ///     The <paramref name="text" /> does not fit to the syntax.
        /// </exception>
        /// <exception cref="ReservedNameException">
        ///     The <paramref name="text" /> contains a reserved name.
        /// </exception>
        protected override void AddToList(string text)
        {
            Parameter    value = parent.AddParameter(text);
            ListViewItem item  = lstItems.Items.Add(value.ToString( ));

            item.Tag        = value;
            item.ImageIndex = Icons.ParameterImageIndex;
        }
Пример #2
0
        /// <summary>
        /// Adds the submitted delegates to the diagram.
        /// </summary>
        private void AddDelegate(DelegateDeclaration dd)
        {
            DelegateType delegateType = diagram.AddDelegate();

            delegateType.Name           = dd.Name;
            delegateType.AccessModifier = dd.Modifiers.ToEnClass();
            delegateType.ReturnType     = dd.ReturnType.ToString();

            foreach (ParameterDeclaration ichParameter in dd.Parameters)
            {
                delegateType.AddParameter(ichParameter.ToString());                 // To Check
            }
        }
Пример #3
0
        /// <summary>
        /// Adds the submitted delegates to the diagram.
        /// </summary>
        /// <param name="delegates">A list of delegates to add.</param>
        private void AddDelegates(IEnumerable <NRDelegate> delegates)
        {
            foreach (NRDelegate nrDelegate in delegates)
            {
                DelegateType delegateType = diagram.AddDelegate();
                delegateType.Name           = nrDelegate.Name;
                delegateType.AccessModifier = nrDelegate.AccessModifier.ToNClass();
                delegateType.ReturnType     = nrDelegate.ReturnType.Name;
                foreach (NRParameter nrParameter in nrDelegate.Parameters)
                {
                    delegateType.AddParameter(nrParameter.Declaration());
                }

                types.Add(nrDelegate, delegateType);
            }
        }
Пример #4
0
        /// <summary>
        /// Reflects the delegate <paramref name="xType"/>.
        /// </summary>
        /// <param name="xType">A type with informations about the delegate which gets reflected.</param>
        private void ReflectDelegate(Type xType)
        {
            if (!xImportSettings.CheckImportDelegate(xType))
            {
                return;
            }
            DelegateType xNewDelegate = xProject.AddDelegate();
            MethodInfo   xMethodInfo  = xType.GetMethod("Invoke");

            xNewDelegate.ReturnType = xMethodInfo.ReturnType.Name;
            foreach (ParameterInfo xParameter in xMethodInfo.GetParameters())
            {
                xNewDelegate.AddParameter(xParameter.ParameterType.Name + " " + xParameter.Name);
            }
            ReflectTypeBase(xType, xNewDelegate);
        }
 public void Execute()
 {
     parameter = delegateType.AddParameter(parameterDeclaration);
 }