ABB.Swum.BaseVerbRule.DetermineMethodRole C# (CSharp) Метод

DetermineMethodRole() приватный Метод

Sets the Role on the given MethodDeclarationNode based on its name.
private DetermineMethodRole ( MethodDeclarationNode mdn ) : void
mdn ABB.Swum.Nodes.MethodDeclarationNode The node to set the role on.
Результат void
        private void DetermineMethodRole(MethodDeclarationNode mdn)
        {
            if (mdn.ReturnType == null)
            {
                //Constructors and destructors don't have a return type.
                //However, they should be processed by a different rule, and therefore shouldn't reach this point.
                mdn.Role = MethodRole.Unknown;
            }
            else if (mdn.ReturnType.Name.ToLower() == "void")
            {
                if (mdn.ParsedName[0].Text.ToLower() == "set")
                {
                    mdn.Role = MethodRole.Setter;
                }
                else
                {
                    mdn.Role = MethodRole.Action;
                }
            }
            else
            {
                if (mdn.ParsedName[0].Text.ToLower() == "get")
                {
                    mdn.Role = MethodRole.Getter;
                }
                else
                {
                    mdn.Role = MethodRole.Function;
                }
            }
        }
    }