本文整理汇总了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());
}
示例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() );
}
示例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() );
}
示例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 );
}
示例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() );
}
示例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 );
}
}
}
}