当前位置: 首页>>代码示例>>C#>>正文


C# Dictionary.toJson方法代码示例

本文整理汇总了C#中System.Collections.Dictionary.toJson方法的典型用法代码示例。如果您正苦于以下问题:C# Dictionary.toJson方法的具体用法?C# Dictionary.toJson怎么用?C# Dictionary.toJson使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Collections.Dictionary的用法示例。


在下文中一共展示了Dictionary.toJson方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RemoteExecute

        public void RemoteExecute(string method, params object[] args)
        {
            Dictionary<string, object> request = new Dictionary<string, object>();
            Dictionary<string, object> requestData = new Dictionary<string, object>();

            // Op code
            request.Add("op", Ness.Op.EXECUTE);

            // Create the data dict
            requestData.Add("method", method);
            requestData.Add("parameters", args);

            // Add it to the request
            request.Add("data", requestData);

            socket.Send(request.toJson());
        }
开发者ID:jeedee,项目名称:ness-node-unity3d,代码行数:17,代码来源:MyClass.cs

示例2: graphRequest

		// Calls a custom Graph API method with the key/value pairs in the Dictionary.  Pass in a null dictionary if no parameters are needed.
		public static void graphRequest( string graphPath, string httpMethod, Dictionary<string,string> parameters )
		{
			if( Application.platform != RuntimePlatform.Android )
				return;

			parameters = parameters ?? new Dictionary<string,string>();

			// call off to java land
			if( !isSessionValid() )
				babysitRequest( true, () => { _facebookPlugin.Call( "graphRequest", graphPath, httpMethod, parameters.toJson() ); } );
			else
				_facebookPlugin.Call( "graphRequest", graphPath, httpMethod, parameters.toJson() );
		}
开发者ID:VidicTH,项目名称:SexyPuzzle,代码行数:14,代码来源:FacebookAndroid.cs

示例3: showFacebookShareDialog

		// Shows the native Facebook Share Dialog. Valid dictionary keys are: description, title, contentURL, imageURL.
		// Results in the shareDialogSucceeded/FailedEvent firing.
		public static void showFacebookShareDialog( Dictionary<string,object> parameters )
		{
			if( Application.platform != RuntimePlatform.Android )
				return;

			_facebookPlugin.Call( "showFacebookShareDialog", parameters.toJson() );
		}
开发者ID:VidicTH,项目名称:SexyPuzzle,代码行数:9,代码来源:FacebookAndroid.cs

示例4: performRequest

		// Performs a request for any available Twitter API methods.  methodType must be either "get" or "post".  path is the
		// url fragment from the API docs (excluding https://api.twitter.com) and parameters is a dictionary of key/value pairs
		// for the given method.  See Twitter's API docs for all available methods
		public static void performRequest( string methodType, string path, Dictionary<string,string> parameters )
		{
			if( Application.platform != RuntimePlatform.Android )
				return;

			string param = parameters != null ? parameters.toJson() : string.Empty;
			_plugin.Call( "performRequest", methodType, path, param );
		}
开发者ID:VidicTH,项目名称:SexyPuzzle,代码行数:11,代码来源:TwitterAndroid.cs

示例5: showFacebookShareDialog

		// Shows the Facebook share dialog. Valid dictionary keys (from FBSDKShareLinkContent) are: description, title, contentURL, imageURL.
		// Results in the shareDialogSucceeded/FailedEvent firing.
		public static void showFacebookShareDialog( Dictionary<string,object> parameters )
		{
			if( Application.platform == RuntimePlatform.IPhonePlayer )
				_facebookShowFacebookShareDialog( parameters.toJson() );
		}
开发者ID:VidicTH,项目名称:SexyPuzzle,代码行数:7,代码来源:FacebookBinding.cs

示例6: graphRequest

		// Allows you to use any available Facebook Graph API method
	    public static void graphRequest( string graphPath, string httpMethod, Dictionary<string,object> keyValueHash )
	    {
	        if( Application.platform == RuntimePlatform.IPhonePlayer )
			{
				// convert the Dictionary to JSON
				string jsonDict = keyValueHash.toJson();
				if( jsonDict != null )
				{
					// if we arent logged in start up the babysitter
					if( !isSessionValid() )
					{
						babysitRequest( true, () => { _facebookGraphRequest( graphPath, httpMethod, jsonDict ); } );
					}
					else
					{
						_facebookGraphRequest( graphPath, httpMethod, jsonDict );
					}
				}
	 		}
		}
开发者ID:VidicTH,项目名称:SexyPuzzle,代码行数:21,代码来源:FacebookBinding.cs


注:本文中的System.Collections.Dictionary.toJson方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。