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


C# Dictionary.toJson方法代码示例

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


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

示例1: 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:arunredmonster,项目名称:app-unity-master,代码行数:11,代码来源:TwitterAndroid.cs

示例2: adsSetUserCookies

	// Sets user cookies for the ad session
	public static void adsSetUserCookies( Dictionary<string,string> cookies )
	{
		if( Application.platform == RuntimePlatform.IPhonePlayer )
			_flurryAdsSetUserCookies( cookies.toJson() );
	}
开发者ID:uptopgames,项目名称:baseproject,代码行数:6,代码来源:FlurryBinding.cs

示例3: showFacebookShareDialog

	// Shows the Facebook share dialog. Valid dictionary keys (from FBShareDialogParams) are: link, name, caption, description, picture, friends (array)
	public static void showFacebookShareDialog( Dictionary<string,object> parameters )
	{
		if( Application.platform == RuntimePlatform.IPhonePlayer )
			_facebookShowFacebookShareDialog( parameters.toJson() );
	}
开发者ID:hanahanaside,项目名称:Wrestling,代码行数:6,代码来源:FacebookBinding.cs

示例4: 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:hanahanaside,项目名称:Wrestling,代码行数:21,代码来源:FacebookBinding.cs

示例5: showDialog

	// Full access to any existing or new Facebook dialogs that get added.  See Facebooks documentation for parameters and dialog types
    public static void showDialog( string dialogType, Dictionary<string,string> options )
    {
        if( Application.platform == RuntimePlatform.IPhonePlayer )
		{
			// if we arent logged in start up the babysitter
			if( !isSessionValid() )
			{
				babysitRequest( false, () => { _facebookShowDialog( dialogType, options.toJson() ); } );
			}
			else
			{
				_facebookShowDialog( dialogType, options.toJson() );
			}
		}
    }
开发者ID:hanahanaside,项目名称:Wrestling,代码行数:16,代码来源:FacebookBinding.cs

示例6: 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.  Path must request .json!  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.IPhonePlayer )
			_twitterPerformRequest( methodType, path, parameters != null ? parameters.toJson() : null );
	}
开发者ID:nhhoang,项目名称:shooting,代码行数:8,代码来源:TwitterBinding.cs

示例7: trackEventWithValueAndMetadata

 // Tracks an event with a value and additional metadata
 public static void trackEventWithValueAndMetadata( string eventIdentifier, float value, Dictionary<string,string> metadata )
 {
     if( Application.platform == RuntimePlatform.IPhonePlayer )
         _chartBoostTrackEventWithValueAndMetadata( eventIdentifier, value, metadata.toJson() );
 }
开发者ID:slightlysocial,项目名称:unity-admanager,代码行数:6,代码来源:ChartBoostBinding.cs

示例8: showDialog

	// Full access to any existing or new Facebook dialogs that get added.  See Facebooks documentation for parameters and dialog types
	public static void showDialog( string dialogType, Dictionary<string,string> parameters )
	{
		if( Application.platform != RuntimePlatform.Android )
			return;

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

		if( !isSessionValid() )
			babysitRequest( false, () => { _facebookPlugin.Call( "showDialog", dialogType, parameters.toJson() ); } );
		else
			_facebookPlugin.Call( "showDialog", dialogType, parameters.toJson() );
	}
开发者ID:hanahanaside,项目名称:QuizBox,代码行数:13,代码来源:FacebookAndroid.cs

示例9: SendEventWithParam

 // Reports an achievement notification the given title and content
 public static void SendEventWithParam( string eventId, Dictionary<string,string> param)
 {
     // Call plugin only when running on real device
     if( Application.platform == RuntimePlatform.IPhonePlayer )
         _sendEventWithParam( eventId , param.toJson());
 }
开发者ID:EchoLei,项目名称:UMengiOSPluginForUnity,代码行数:7,代码来源:UMengBinding.cs

示例10: startWithAppIdAndUserData

	// Starts up the SDK with the given appId and userData. See VGUserData for allowed values.
	public static void startWithAppIdAndUserData( string appId, Dictionary<string,object> userData )
	{
		if( Application.platform == RuntimePlatform.IPhonePlayer )
			_vungleStartWithAppIdAndUserData( appId, userData.toJson() );
	}
开发者ID:uptopgames,项目名称:baseproject,代码行数:6,代码来源:VungleBinding.cs

示例11: Add

    /// <summary>
    /// Add the specified val and metadata.
    /// </summary>
    /// <param name='val'>
    /// Value.
    /// </param>
    /// <param name='metadata'>
    /// Metadata.
    /// </param>
    public void Add(String val, Dictionary<String, String> metadata){
#if UNITY_ANDROID
        javaObject.Call ("add", val, DictionaryToAndroidHashMap(metadata)); 
#elif UNITY_IOS
        string metadataAsJSON = null != metadata ? metadata.toJson() : null;
        if(null != addStringWithMetadataToList) {
            addStringWithMetadataToList(key,val,metadataAsJSON);
        }
#endif
    }
开发者ID:EJBQ,项目名称:Bae-Zeus-X,代码行数:19,代码来源:AGSSyncableList.cs

示例12: Set

 /// <summary>
 /// Set the specified val and metadata.
 /// </summary>
 /// <param name='val'>
 /// Value.
 /// </param>
 /// <param name='metadata'>
 /// Metadata.
 /// </param>
 public void Set(string val, Dictionary<string, string> metadata)
 {
     #if UNITY_ANDROID
         javaObject.Call ("set", val, DictionaryToAndroidHashMap(metadata));
     #elif UNITY_IOS && !UNITY_EDITOR
     string metadataAsJSON = (null != metadata) ? metadata.toJson() : null;
     _AmazonGCWSSetLatestStringMetadataAsJSON(key, val, metadataAsJSON);
     #endif
 }
开发者ID:EJBQ,项目名称:Bae-Zeus-X,代码行数:18,代码来源:AGSSyncableString.cs

示例13: Set

      /// <summary>
      /// Set the specified val and metadata.
      /// </summary>
      /// <param name='val'>
      /// Value.
      /// </param>
      /// <param name='metadata'>
      /// Metadata.
      /// </param>
    public void Set(string val, Dictionary<string,string> metadata){
#if UNITY_ANDROID
        javaObject.Call ("set", val, DictionaryToAndroidHashMap(metadata));    
#elif UNITY_IOS
        string metadataAsJSON = null != metadata ? metadata.toJson() : null;
        if(null != setNumberWithStringAndMetadata) {
            setNumberWithStringAndMetadata(key, val, metadataAsJSON);
        }       
#endif
    }
开发者ID:EJBQ,项目名称:Bae-Zeus-X,代码行数:19,代码来源:AGSSyncableNumber.cs

示例14: 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:hanahanaside,项目名称:QuizBox,代码行数:14,代码来源:FacebookAndroid.cs

示例15: showDialog

 // Full access to any existing or new Facebook dialogs that get added.  See Facebooks documentation for parameters and dialog types
 public static void showDialog( string dialogType, Dictionary<string,string> options )
 {
     if( Application.platform == RuntimePlatform.IPhonePlayer )
         _facebookShowDialog( dialogType, options.toJson() );
 }
开发者ID:tehr0b,项目名称:heartillery,代码行数:6,代码来源:FacebookBinding.cs


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