コード例 #1
0
ファイル: Field.cs プロジェクト: windupbutton/graphql
        public override int GetHashCode()
        {
            var result = Name.GetHashCode();

            if (Alias != null)
            {
                result ^= Alias.GetHashCode();
            }

            if (Arguments != null)
            {
                result = Arguments.Aggregate(result, (x, y) => x ^ y.GetHashCode());
            }

            if (Directives != null)
            {
                result = Directives.Aggregate(result, (x, y) => x ^ y.GetHashCode());
            }

            if (SelectionSet != null)
            {
                result = SelectionSet.Aggregate(result, (x, y) => x ^ y.GetHashCode());
            }

            return(result);
        }
コード例 #2
0
ファイル: ProcedureType.cs プロジェクト: Hejsil/TheLang
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ (Return != null ? Return.GetHashCode() : 0);
         return(Arguments.Aggregate(hashCode, (current, arg) => (current * 397) ^ (arg != null ? arg.GetHashCode() : 0)));
     }
 }
コード例 #3
0
        public override string ToString()
        {
            var argumentStr = Arguments.Aggregate(string.Empty, (a, b) => a.ToString() + ", " + b.ToString());

            if (argumentStr.Length > 0)
            {
                argumentStr = argumentStr.Substring(1).Trim();
            }

            return(Name + "( " + argumentStr + (argumentStr.Length == 0 ? "" : " ") + ((ReturnType == null || string.IsNullOrEmpty(ReturnType.Type)) ? ")" : (") : " + ReturnType.Type)));
        }
コード例 #4
0
ファイル: NLogExceptionLogger.cs プロジェクト: tautvisv/SD2WA
            private string CreateArguments()
            {
                var returnValue = "";

                if (Arguments == null)
                {
                    return(returnValue);
                }
                returnValue = Arguments.Aggregate(returnValue, (current, argument) => current + (" " + argument.Key + ": " + argument.Value));
                return(string.Format("{{{0}}}", returnValue));
            }
コード例 #5
0
 public override string ToString()
 {
     return("call " + FunctionName + " with args " + Arguments.Aggregate("", (acc, item) => acc + item + ","));
 }
コード例 #6
0
 public override string ToString()
 {
     return("Declare " + MethodName + " ret: " + MethodReturnType + ", args " + Arguments.Aggregate("", (a, b) => a + b + ",") + " with body " + Body.ScopedStatements.Aggregate("", (acc, item) => acc + item + ","));
 }