public Dictionary<string, object> Fetch()
        {
            var result = new Dictionary<string, object>();

            result.Apply(Fetch(Source));

            return result;
        }
        public Dictionary <string, object> Fetch()
        {
            var result = new Dictionary <string, object>();

            result.Apply(Fetch(Source));

            return(result);
        }
コード例 #3
0
        public object ExecuteFields(ExecutionContext context, ObjectGraphType rootType, object source, Dictionary <string, Fields> fields)
        {
            var result = new Dictionary <string, object>();

            fields.Apply(pair =>
            {
                result[pair.Key] = ResolveField(context, rootType, source, pair.Value);
            });

            return(result);
        }
        private Dictionary<string, object> Fetch(CriteriaOperator source)
        {
            var result = new Dictionary<string, object>();


            var groupOperator = source as GroupOperator;

            if (groupOperator != null)
            {
                result.Apply(Fetch(groupOperator));

                return result;
            }


            var aggregateOperand = source as AggregateOperand;

            if (aggregateOperand != null)
            {
                result.Apply(Fetch(aggregateOperand));

                return result;
            }


            var binaryOperator = source as BinaryOperator;

            if (binaryOperator != null)
            {
                result.Apply(Fetch(binaryOperator));

                return result;
            }


            return result;
        }
        private Dictionary <string, object> Fetch(CriteriaOperator source)
        {
            var result = new Dictionary <string, object>();


            var groupOperator = source as GroupOperator;

            if (groupOperator != null)
            {
                result.Apply(Fetch(groupOperator));

                return(result);
            }


            var aggregateOperand = source as AggregateOperand;

            if (aggregateOperand != null)
            {
                result.Apply(Fetch(aggregateOperand));

                return(result);
            }


            var binaryOperator = source as BinaryOperator;

            if (binaryOperator != null)
            {
                result.Apply(Fetch(binaryOperator));

                return(result);
            }


            return(result);
        }
        private Dictionary <string, object> Fetch(GroupOperator source)
        {
            var result = new Dictionary <string, object>();


            var operands = source.Operands;

            foreach (var operand in operands)
            {
                result.Apply(Fetch(operand));
            }


            return(result);
        }
コード例 #7
0
      /// <summary>Returns all configration parameters and their values, nicely printed.</summary>
      public IEnumerable<string> Dump() {
         var config = new Dictionary<string, string>();
         _configuration.Apply(kv => config.Add(kv.Key, (kv.Value is string) ? (string)kv.Value : "(multiple values)"));
         var dump = new List<string>();

         // dump all params, which are found in all assemblies (printing configured value, or the default)
         _apply((fi, key, value) => {
            config.Remove(key);
            dump.Add(key.Replace(_rootKeyPath, "") + ": " + ((value is string) ? fi.GetValue(null) : "(multiple values)"));
         });

         // dump all params, which have configuration entires, but there are no such fields found anywhere
         config.Apply(kv => {
            dump.Add("UNUSED: " + kv.Key.Replace(_rootKeyPath, "") + ": " + kv.Value);
         });

         return dump;
      }
コード例 #8
0
ファイル: RequestHandler.cs プロジェクト: poma/remote-server
        public static string HandleKeypress(string key, string s_count)
        {
            if (key == null)
            {
                return("empty-key");
            }
            Log("Keypress: " + key);
            int count = String.IsNullOrEmpty(s_count) ? 1 : int.Parse(s_count, NumberStyles.HexNumber);

            if (count == 0)
            {
                SingleMediaKeys.Apply(key, InputSimulator.Keyboard.KeyPress);
                SingleHandlers.Apply(key, act => act());
                YoutubeLists.Apply(key, LaunchYoutube);
            }

            MultipleMediaKeys.Apply(key, InputSimulator.Keyboard.KeyPress);
            MultipleHandlers.Apply(key, act => act(count));

            return("ok");
        }
        private void Display_Side_Score_Data( EGameSide side, Dictionary< ECardColor, int > scores, CSideMatchStats side_data )
        {
            CClientResource.Output_Text< EClientTextID >( EClientTextID.Client_Match_Score_Side_Header, side.ToString() );
            scores.Apply( p => CClientResource.Output_Text< EClientTextID >( EClientTextID.Client_Match_Score_Color, p.Key.ToString(), p.Value ) );

            CClientResource.Output_Text< EClientTextID >( EClientTextID.Client_Match_Score_Game_Total, scores.Aggregate( 0, ( sum, val ) => sum + val.Value ) );
            CClientResource.Output_Text< EClientTextID >( EClientTextID.Client_Match_Score_Game_Results, side_data.GamesWon, side_data.GamesLost, side_data.GamesDrawn );
            CClientResource.Output_Text< EClientTextID >( EClientTextID.Client_Match_Score_Match_Total, side_data.Score );
        }
コード例 #10
0
        private Dictionary<string, object> Fetch(GroupOperator source)
        {
            var result = new Dictionary<string, object>();


            var operands = source.Operands;

            foreach (var operand in operands)
            {
                result.Apply(Fetch(operand));
            }


            return result;
        }
コード例 #11
0
ファイル: PaintConverter.cs プロジェクト: borkaborka/gmit
 static PaintConverter() {
    _builtinPens = new Dictionary<string, Pen>() {
        { "flat", new Pen { StartLineCap = PenLineCap.Flat, EndLineCap = PenLineCap.Flat, LineJoin = PenLineJoin.Bevel } },
        { "square", new Pen { StartLineCap = PenLineCap.Square, EndLineCap = PenLineCap.Square, LineJoin = PenLineJoin.Bevel } },
        { "round", new Pen { StartLineCap = PenLineCap.Round, EndLineCap = PenLineCap.Round, LineJoin = PenLineJoin.Round } }
    };
    _builtinPens.Apply(kvp => kvp.Value.Freeze());
 }