public Dictionary<string, object> Fetch() { var result = new Dictionary<string, object>(); result.Apply(Fetch(Source)); 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; }
/// <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; }
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 ); }
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; }
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()); }