本文整理汇总了C#中System.Dynamic.ExpandoObject.r方法的典型用法代码示例。如果您正苦于以下问题:C# ExpandoObject.r方法的具体用法?C# ExpandoObject.r怎么用?C# ExpandoObject.r使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Dynamic.ExpandoObject
的用法示例。
在下文中一共展示了ExpandoObject.r方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: _createKey
private dynamic _createKey() {
dynamic key = new ExpandoObject();
key.b = (Func<string, int>)( p1 => p1.Length );
key.r = (Func<double, int>)( p1 => (int)Math.Floor( p1 ) );
key.i = (Func<int, int>)( p1 => key.r( rand.NextDouble() * p1 ) );
key.j = (Func<int>)( () => 8 );
key.k = (Func<double, double, double>)( ( p1, p2 ) => (int)p1 ^ (int)p2 );
key.l = (Func<string, int, int, double>)( ( p1, p2, p3 ) => {
double d;
if ( double.TryParse( p1.substr( p2, p3 ), out d ) ) {
return d;
}
return double.NaN;
} );
key.m = (Func<double, double, double>)( ( p1, p2 ) => p1 - p2 );
key.n = (Func<double>)( () => key.r( DateTime.Now.getTime() / 1000 ) );
key.o = (Func<double, double, double>)( ( p1, p2 ) => p2 / p1 );
key.p = (Func<double, double, double>)( ( p1, p2 ) => p2 % p1 );
key.q = (Func<double>)( () => 1.44269504088896 );
key.s = (Func<object, string>)( p1 => p1.ToString() );
key.t = (Func<object[], string>)( ps => string.Join( "", ps ) );
key.u = (Func<double, double, double>)( ( p1, p2 ) => p1 + p2 );
key.v = (Func<int>)( () => 16 );
key.w = (Func<int>)( () => 2 );
key.x = (Func<int>)( () => 4 );
key.y = (Func<int, double>)( p1 => Math.Sqrt( p1 ) );
key.z = (Func<double, double, double>)( ( p1, p2 ) => p1 * p2 );
return ( key );
}