DataDictionary.Functions.Procedure.GetFormalParameter C# (CSharp) Method

GetFormalParameter() public method

Provides the formal parameter whose name corresponds to the name provided
public GetFormalParameter ( string name ) : Parameter
name string
return Parameter
        public Parameter GetFormalParameter(string name)
        {
            Parameter retVal = null;

            foreach (Parameter parameter in FormalParameters)
            {
                if (parameter.Name.Equals(name))
                {
                    retVal = parameter;
                    break;
                }
            }

            return retVal;
        }

Usage Example

Exemplo n.º 1
0
        /// <summary>
        ///     Sets the update information for this procedure
        /// </summary>
        /// <param name="source">The source procedure this procedure updates</param>
        public override void SetUpdateInformation(ModelElement source)
        {
            base.SetUpdateInformation(source);
            Procedure sourceProcedure = (Procedure)source;

            // In addition to indicating the function's update information, we need to create links for each parameter
            foreach (Parameter parameter in FormalParameters)
            {
                Parameter baseParameter = sourceProcedure.GetFormalParameter(parameter.Name);
                if (baseParameter != null)
                {
                    parameter.SetUpdateInformation(baseParameter);
                }
            }

            foreach (Rule rule in Rules)
            {
                Rule baseRule = sourceProcedure.FindRule(rule.Name);
                if (baseRule != null)
                {
                    rule.SetUpdateInformation(baseRule);
                }
            }
        }