本文整理匯總了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 );
}