예제 #1
0
파일: SUnit.cs 프로젝트: herbertkb/Swummary
        // Constructor for a SUnit of user-specified SUnitType with a return type
        public SUnit(SUnitType type, string action, string theme, string lhs, IEnumerable<string> args, string returnType)
        {
            this.type = type;
            this.action = action;
            this.theme = theme;
            this.lhs = lhs;
            this.args = args;

            if (lhs != null)
            {
                this.lhs = lhs;
                hasLHS = true;
            }
            else
            {
                this.lhs = lhs;
                hasLHS = false;
            }

            if (args != null)
            {
                this.args = args;
                hasArgs = true;
            }
            else
            {
                this.args = null;
                hasArgs = false;
            }

            if (returnType != null && !returnType.Equals("void"))
            {
                hasReturnType = true;
                this.returnType = returnType;
            }
            else
            {
                hasReturnType = false;
                this.returnType = null;
            }
        }
예제 #2
0
파일: SUnit.cs 프로젝트: neostoic/Swummary
        // Constructor for a SUnit of user-specified SUnitType with a return type
        public SUnit(SUnitType type, string action, string theme, string lhs, IEnumerable <string> args, string returnType)
        {
            this.type   = type;
            this.action = action;
            this.theme  = theme;
            this.lhs    = lhs;
            this.args   = args;

            if (lhs != null)
            {
                this.lhs = lhs;
                hasLHS   = true;
            }
            else
            {
                this.lhs = lhs;
                hasLHS   = false;
            }

            if (args != null)
            {
                this.args = args;
                hasArgs   = true;
            }
            else
            {
                this.args = null;
                hasArgs   = false;
            }

            if (returnType != null && !returnType.Equals("void"))
            {
                hasReturnType   = true;
                this.returnType = returnType;
            }
            else
            {
                hasReturnType   = false;
                this.returnType = null;
            }
        }