本文整理汇总了C#中ErrorCallback类的典型用法代码示例。如果您正苦于以下问题:C# ErrorCallback类的具体用法?C# ErrorCallback怎么用?C# ErrorCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ErrorCallback类属于命名空间,在下文中一共展示了ErrorCallback类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreatePhysics
private Physics CreatePhysics(ErrorCallback errorCallback = null)
{
if (Physics.Instantiated)
Assert.Fail("Physics is still created");
if (errorCallback == null)
errorCallback = _errorLog = new ErrorLog();
if (_physics != null)
{
_physics.Dispose();
_physics = null;
}
if (_foundation != null)
{
_foundation.Dispose();
_foundation = null;
}
_foundation = new Foundation(errorCallback);
_physics = new Physics(_foundation, checkRuntimeFiles: true);
return _physics;
}
开发者ID:flair2005,项目名称:PhysX.Net,代码行数:25,代码来源:Test.cs
示例2: GetUserAccountInfo
/// <summary>
/// Retrieves the relevant details for a specified user, based upon a match against a supplied unique identifier
/// </summary>
public static void GetUserAccountInfo(LookupUserAccountInfoRequest request, GetUserAccountInfoCallback resultCallback, ErrorCallback errorCallback)
{
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");
string serializedJSON = JsonConvert.SerializeObject(request, Util.JsonFormatting, Util.JsonSettings);
Action<string,string> callback = delegate(string responseStr, string errorStr)
{
LookupUserAccountInfoResult result = null;
PlayFabError error = null;
ResultContainer<LookupUserAccountInfoResult>.HandleResults(responseStr, errorStr, out result, out error);
if(error != null && errorCallback != null)
{
errorCallback(error);
}
if(result != null)
{
if(resultCallback != null)
{
resultCallback(result);
}
}
};
PlayFabHTTP.Post(PlayFabSettings.GetURL()+"/Admin/GetUserAccountInfo", serializedJSON, "X-SecretKey", PlayFabSettings.DeveloperSecretKey, callback);
}
开发者ID:FaunaFace,项目名称:UnitySDK,代码行数:28,代码来源:PlayFabAdminAPI.cs
示例3: writeScore
/**
* Speichert den Score
*/
public void writeScore(ErrorCallback ecb, string playerName, int score, int level, long time, int mode)
{
time /= 10000;
this.ecb = ecb;
XDocument doc = new XDocument(
new XElement("scoreentry",
new XElement("playername", playerName),
new XElement("score", score),
new XElement("level", level),
new XElement("time", time),
new XElement("mode", mode)
)
);
postData = doc.ToString();
try
{
WebRequest request = WebRequest.Create(proxy);
request.Method = "POST";
request.ContentType = "text/xml";
request.BeginGetRequestStream(new AsyncCallback(RequestReady), request);
}
catch (Exception e)
{ ecb(e.Message); }
}
开发者ID:stas-bob,项目名称:Tetris,代码行数:28,代码来源:SQLClient.cs
示例4: InsertEntity
private static object InsertEntity(object entity, DataStrategy dataStrategy, string tableName, ErrorCallback onError, bool resultRequired)
{
var dictionary = entity as IDictionary<string, object>;
if (dictionary != null)
return dataStrategy.Insert(tableName, dictionary, resultRequired);
var list = entity as IEnumerable<IDictionary<string, object>>;
if (list != null)
return dataStrategy.InsertMany(tableName, list, onError, resultRequired);
var entityList = entity as IEnumerable;
if (entityList != null)
{
var array = entityList.Cast<object>().ToArray();
var rows = new List<IDictionary<string, object>>();
foreach (var o in array)
{
dictionary = (o as IDictionary<string, object>) ?? o.ObjectToDictionary();
if (dictionary.Count == 0)
{
throw new SimpleDataException("Could not discover data in object.");
}
rows.Add(dictionary);
}
return dataStrategy.InsertMany(tableName, rows, onError, resultRequired);
}
dictionary = entity.ObjectToDictionary();
if (dictionary.Count == 0)
throw new SimpleDataException("Could not discover data in object.");
return dataStrategy.Insert(tableName, dictionary, resultRequired);
}
开发者ID:hlach,项目名称:Simple.Data,代码行数:33,代码来源:InsertCommand.cs
示例5: PlayerLeft
/// <summary>
/// Informs the PlayFab game server hosting service that the indicated user has left the Game Server Instance specified
/// </summary>
public static void PlayerLeft(PlayerLeftRequest request, PlayerLeftCallback resultCallback, ErrorCallback errorCallback, object customData = null)
{
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");
string serializedJSON = JsonConvert.SerializeObject(request, Util.JsonFormatting, Util.JsonSettings);
Action<string,PlayFabError> callback = delegate(string responseStr, PlayFabError pfError)
{
PlayerLeftResponse result = null;
ResultContainer<PlayerLeftResponse>.HandleResults(responseStr, ref pfError, out result);
if(pfError != null && errorCallback != null)
{
errorCallback(pfError);
}
if(result != null)
{
result.CustomData = customData;
result.Request = request;
if(resultCallback != null)
{
resultCallback(result);
}
}
};
PlayFabHTTP.Post(PlayFabSettings.GetURL()+"/Matchmaker/PlayerLeft", serializedJSON, "X-SecretKey", PlayFabSettings.DeveloperSecretKey, callback);
}
开发者ID:noxplague,项目名称:UnitySDK,代码行数:29,代码来源:PlayFabMatchmakerAPI.cs
示例6: BaseRequest
public BaseRequest (String method, String url, SuccessCallback successCallback, ErrorCallback errorCallback):base(method, url)
{
this.completedCallback = delegate(Request request) { onCompleteCallback(request); };;
this.successCallback = successCallback;
this.errorCallback = errorCallback;
form = AddParams();
}
开发者ID:SonGit,项目名称:NailGame,代码行数:8,代码来源:BaseRequest.cs
示例7: SubmitScoreRequest
public SubmitScoreRequest (String url, String score, SuccessCallback successCallback, ErrorCallback errorCallback): base(Method.POST, url, successCallback, errorCallback)
{
Hashtable hashtable = new Hashtable ();
string json = Json.Serialize(hashtable );
this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
this.AddWWWForm(this.form);
}
开发者ID:SonGit,项目名称:NailGame,代码行数:8,代码来源:SubmitScoreRequest.cs
示例8: LoginFacebookRequest
public LoginFacebookRequest (String url, string token, SuccessCallback successCallback, ErrorCallback errorCallback) : base(Method.POST, url, successCallback, errorCallback)
{
Hashtable hashtable = new Hashtable ();
hashtable.Add( GameConstants.REQUEST_KEY_TOKEN, token );
string json = Json.Serialize(hashtable );
this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
this.AddWWWForm(this.form);
}
开发者ID:SonGit,项目名称:NailGame,代码行数:10,代码来源:LoginFacebookRequest.cs
示例9: GetHighScoresRequest
public GetHighScoresRequest (String url, String sessionKey, String level, SuccessCallback successCallback, ErrorCallback errorCallback): base(Method.POST, url, successCallback, errorCallback)
{
Hashtable hashtable = new Hashtable ();
hashtable.Add( GameConstants.REQUEST_KEY_SESSION_KEY, sessionKey );
hashtable.Add( GameConstants.REQUEST_KEY_LEVEL, level );
string json = Json.Serialize(hashtable );
this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
this.AddWWWForm(this.form);
}
开发者ID:SonGit,项目名称:NailGame,代码行数:10,代码来源:GetHighScoresRequest.cs
示例10: GenerateAnonymousAcountRequest
public GenerateAnonymousAcountRequest (String url, string deviceId, SuccessCallback successCallback, ErrorCallback errorCallback) : base(Method.POST, url, successCallback, errorCallback)
{
Hashtable hashtable = new Hashtable ();
hashtable.Add( GameConstants.REQUEST_KEY_DEVICE_ID, deviceId );
string json = Json.Serialize(hashtable );
this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
this.AddWWWForm(this.form);
}
开发者ID:SonGit,项目名称:NailGame,代码行数:10,代码来源:GenerateAnonymousAcountRequest.cs
示例11: SubmitRequestAcceptRequest
public SubmitRequestAcceptRequest (String url, string sessionKey, string requestIds, SuccessCallback successCallback, ErrorCallback errorCallback) : base(Method.POST, url, successCallback, errorCallback)
{
Hashtable hashtable = new Hashtable ();
hashtable.Add( GameConstants.REQUEST_KEY_SESSION_KEY, sessionKey );
hashtable.Add( GameConstants.REQUEST_KEY_REQUEST_IDS, requestIds );
string json = Json.Serialize(hashtable );
this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
this.AddWWWForm(this.form);
}
开发者ID:SonGit,项目名称:NailGame,代码行数:11,代码来源:SubmitRequestAcceptRequest.cs
示例12: CreatePhysics
private Physics CreatePhysics(ErrorCallback errorCallback = null)
{
if (Physics.Instantiated)
Assert.Fail("Physics is still created");
var foundation = new Foundation(errorCallback);
var physics = new Physics(foundation, checkRuntimeFiles: true);
return physics;
}
开发者ID:zwagoth,项目名称:PhysX.net,代码行数:11,代码来源:Test.cs
示例13: UpsertByKeyFields
internal static object UpsertByKeyFields(string tableName, DataStrategy dataStrategy, object entity, IEnumerable<string> keyFieldNames, bool isResultRequired, ErrorCallback errorCallback)
{
var record = UpdateCommand.ObjectToDictionary(entity);
var list = record as IList<IDictionary<string, object>>;
if (list != null) return dataStrategy.UpsertMany(tableName, list, keyFieldNames, isResultRequired, errorCallback);
var dict = record as IDictionary<string, object>;
var criteria = GetCriteria(keyFieldNames, dict);
var criteriaExpression = ExpressionHelper.CriteriaDictionaryToExpression(tableName, criteria);
return dataStrategy.Upsert(tableName, dict, criteriaExpression, isResultRequired);
}
开发者ID:hlach,项目名称:Simple.Data,代码行数:11,代码来源:UpsertByCommand.cs
示例14: LoginRequest
public LoginRequest (String url, string userName, string password, SuccessCallback successCallback, ErrorCallback errorCallback) : base(Method.POST, url, successCallback, errorCallback)
{
Hashtable hashtable = new Hashtable ();
hashtable.Add( GameConstants.REQUEST_KEY_USER_NAME, userName );
hashtable.Add( GameConstants.REQUEST_KEY_PASSWORD, password );
string json = Json.Serialize(hashtable );
this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
this.AddWWWForm(this.form);
}
开发者ID:SonGit,项目名称:NailGame,代码行数:11,代码来源:LoginRequest.cs
示例15: ShareStoryRequest
public ShareStoryRequest (String url, string uid, string type, string data, SuccessCallback successCallback, ErrorCallback errorCallback) : base(Method.POST, url, successCallback, errorCallback)
{
Hashtable hashtable = new Hashtable ();
hashtable.Add( GameConstants.REQUEST_KEY_UID, uid );
hashtable.Add( GameConstants.REQUEST_KEY_TYPE, type );
hashtable.Add( GameConstants.RESPONE_KEY_DATA, data );
string json = Json.Serialize(hashtable );
this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
this.AddWWWForm(this.form);
}
开发者ID:SonGit,项目名称:NailGame,代码行数:12,代码来源:ShareStoryRequest.cs
示例16: UpdateAcountInfoRequest
public UpdateAcountInfoRequest (String url, string sessionKey, string displayName, string avatar, SuccessCallback successCallback, ErrorCallback errorCallback) : base(Method.POST, url, successCallback, errorCallback)
{
Hashtable hashtable = new Hashtable ();
hashtable.Add( GameConstants.REQUEST_KEY_SESSION_KEY, sessionKey );
hashtable.Add( GameConstants.REQUEST_KEY_DISPLAY_NAME, displayName );
hashtable.Add( GameConstants.REQUEST_KEY_AVATAR, avatar );
string json = Json.Serialize(hashtable );
this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
this.AddWWWForm(this.form);
}
开发者ID:SonGit,项目名称:NailGame,代码行数:12,代码来源:UpdateAcountInfoRequest.cs
示例17: GetProperties
/// <summary>
/// Gets all the configurable properties of the specified element type.
/// </summary>
/// <param name="element">The element type. Must be a class with the <see cref="ConfigurableElementAttribute">ConfigurableElementAttribute</see> attribute.</param>
/// <param name="errorCallback">An <see cref="ErrorCallback">ErrorCallback</see>.</param>
/// <returns>All the configurable properties found on the element, or null if the element is not configurable.</returns>
public static IEnumerable<IConfigurablePropertyInfo> GetProperties(Type element, ErrorCallback errorCallback)
{
if (!Attribute.IsDefined(element, typeof(ConfigurableElementAttribute)))
return null;
var t = typeof(ConfigurablePropertyInfo<object>).GetGenericTypeDefinition();
return from p in element.GetProperties()
where Attribute.IsDefined(p, typeof(ConfigurablePropertyAttribute))
let a = p.GetAttribute<ConfigurablePropertyAttribute>()
let r = TryUtils.TryGetResult(() => TryUtils.TryCreateInstance<IConfigurablePropertyInfo>(t.MakeGenericType(element), p, a), errorCallback)
where r != null
select r;
}
开发者ID:OronDF343,项目名称:ModularFramework,代码行数:18,代码来源:ConfigurationUtils.cs
示例18: GetInviteFriendRequest
public GetInviteFriendRequest (String url, String sessionKey, String limit, String next, SuccessCallback successCallback, ErrorCallback errorCallback): base(Method.POST, url, successCallback, errorCallback)
{
Hashtable hashtable = new Hashtable ();
hashtable.Add( GameConstants.REQUEST_KEY_SESSION_KEY, sessionKey );
hashtable.Add( GameConstants.REQUEST_KEY_LIMIT, limit );
hashtable.Add( GameConstants.REQUEST_KEY_NEXT, next );
string json = Json.Serialize(hashtable );
this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
this.AddWWWForm(this.form);
}
开发者ID:SonGit,项目名称:NailGame,代码行数:12,代码来源:GetInviteFriendRequest.cs
示例19: GetFriendPlayedGameRequest
public GetFriendPlayedGameRequest (String url, String sessionKey, String page, String count, SuccessCallback successCallback, ErrorCallback errorCallback): base(Method.POST, url, successCallback, errorCallback)
{
Hashtable hashtable = new Hashtable ();
hashtable.Add( GameConstants.REQUEST_KEY_SESSION_KEY, sessionKey );
hashtable.Add( GameConstants.REQUEST_KEY_PAGE, page );
hashtable.Add( GameConstants.REQUEST_KEY_COUNT, count );
string json = Json.Serialize(hashtable );
this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
this.AddWWWForm(this.form);
}
开发者ID:SonGit,项目名称:NailGame,代码行数:12,代码来源:GetFriendPlayedGameRequest.cs
示例20: SubmitDeviceRequest
public SubmitDeviceRequest (String url, string platform, string model, string imei, string version, string appVersion, SuccessCallback successCallback, ErrorCallback errorCallback) : base(Method.POST, url, successCallback, errorCallback)
{
Hashtable hashtable = new Hashtable ();
hashtable.Add( GameConstants.REQUEST_KEY_PLATFORM, platform );
hashtable.Add( GameConstants.REQUEST_KEY_MODEL, model );
hashtable.Add( GameConstants.REQUEST_KEY_IMEI, imei );
hashtable.Add( GameConstants.REQUEST_KEY_VERSION, version );
hashtable.Add( GameConstants.REQUEST_KEY_APP_VERSION, appVersion );
string json = Json.Serialize(hashtable );
this.form.AddField( GameConstants.REQUEST_KEY_PARAMS, Encryption.Encrypt(json) );
this.AddWWWForm(this.form);
}
开发者ID:SonGit,项目名称:NailGame,代码行数:14,代码来源:SubmitDeviceRequest.cs
注:本文中的ErrorCallback类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论