當前位置: 首頁>>代碼示例>>C#>>正文


C# ExpandoObject.r方法代碼示例

本文整理匯總了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 );
		}
開發者ID:wangxd1213,項目名稱:kcapi_in_csharp_impl,代碼行數:29,代碼來源:PortAPI.cs


注:本文中的System.Dynamic.ExpandoObject.r方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。